mirror of
https://github.com/esauflores/databases.git
synced 2026-03-08 22:44:00 +00:00
chore: Add initial PostgreSQL configuration files and Docker setup
This commit is contained in:
4
postgres/.env.example
Normal file
4
postgres/.env.example
Normal file
@@ -0,0 +1,4 @@
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=postgres
|
||||
POSTGRES_DB=postgres
|
||||
POSTGRES_PORT=5432
|
||||
1
postgres/Dockerfile
Normal file
1
postgres/Dockerfile
Normal file
@@ -0,0 +1 @@
|
||||
FROM postgres:18.3-alpine
|
||||
22
postgres/compose.yml
Normal file
22
postgres/compose.yml
Normal file
@@ -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:
|
||||
Reference in New Issue
Block a user