commit 70a656caf6e5226ec8348942809f8fc3e235f4cb Author: Cesar Flores Date: Sat Mar 7 04:03:48 2026 +0700 chore: Add initial PostgreSQL configuration files and Docker setup diff --git a/postgres/.env.example b/postgres/.env.example new file mode 100644 index 0000000..5e257e2 --- /dev/null +++ b/postgres/.env.example @@ -0,0 +1,4 @@ +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgres +POSTGRES_DB=postgres +POSTGRES_PORT=5432 diff --git a/postgres/Dockerfile b/postgres/Dockerfile new file mode 100644 index 0000000..224ab2b --- /dev/null +++ b/postgres/Dockerfile @@ -0,0 +1 @@ +FROM postgres:18.3-alpine diff --git a/postgres/compose.yml b/postgres/compose.yml new file mode 100644 index 0000000..c8626e6 --- /dev/null +++ b/postgres/compose.yml @@ -0,0 +1,22 @@ +services: + postgres: + build: + context: . + dockerfile: Dockerfile + restart: unless-stopped + environment: + POSTGRES_USER: ${POSTGRES_USER:-postgres} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} + POSTGRES_DB: ${POSTGRES_DB:-postgres} + ports: + - "${POSTGRES_PORT:-5432}:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}"] + interval: 10s + timeout: 5s + retries: 5 + +volumes: + postgres_data: