2023-09-17 17:59:01 +02:00
|
|
|
volumes:
|
2023-09-18 00:24:22 +02:00
|
|
|
ddon-psql-data:
|
2025-04-20 16:06:23 +02:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
ddon-psql-net:
|
|
|
|
|
|
2023-09-17 17:59:01 +02:00
|
|
|
services:
|
2025-04-18 16:58:42 +02:00
|
|
|
db:
|
|
|
|
|
container_name: db
|
2025-05-20 22:17:11 +02:00
|
|
|
image: postgres:17
|
2023-09-17 17:59:01 +02:00
|
|
|
ports:
|
2023-09-18 00:24:22 +02:00
|
|
|
- "5432:5432"
|
|
|
|
|
restart: no
|
2025-04-20 16:06:23 +02:00
|
|
|
networks:
|
|
|
|
|
- ddon-psql-net
|
2023-09-17 17:59:01 +02:00
|
|
|
volumes:
|
2023-09-18 00:24:22 +02:00
|
|
|
- ddon-psql-data:/var/lib/postgresql/data
|
2025-04-12 17:01:55 +02:00
|
|
|
# - ./schema_postgres.sql:/docker-entrypoint-initdb.d/schema_postgres.sql:ro
|
2025-04-20 16:06:23 +02:00
|
|
|
- ./postgresql.conf:/etc/postgresql/postgresql.conf:ro
|
2023-09-17 17:59:01 +02:00
|
|
|
environment:
|
2025-04-18 16:58:42 +02:00
|
|
|
- POSTGRES_USER=postgres
|
|
|
|
|
- POSTGRES_PASSWORD=postgres
|
2023-09-17 17:59:01 +02:00
|
|
|
- POSTGRES_DB=postgres
|
|
|
|
|
- POSTGRES_INITDB_ARGS=--auth=scram-sha-256 --lc-numeric=en_US.UTF-8
|
|
|
|
|
command: postgres -c config_file=/etc/postgresql/postgresql.conf
|
2023-09-18 00:24:22 +02:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready", "-d", "postgres"]
|
2023-09-21 23:16:47 +02:00
|
|
|
interval: 10s
|
|
|
|
|
timeout: 1s
|
2023-09-18 00:24:22 +02:00
|
|
|
retries: 3
|
2025-04-20 16:06:23 +02:00
|
|
|
|
2025-04-20 20:45:14 +02:00
|
|
|
db-migrate:
|
|
|
|
|
image: postgres:17-alpine
|
|
|
|
|
depends_on:
|
|
|
|
|
- db
|
|
|
|
|
networks:
|
|
|
|
|
- ddon-psql-net
|
|
|
|
|
volumes:
|
|
|
|
|
- ./postgres-specific-migration.sql:/postgres-specific-migration.sql:ro
|
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
|
|
|
|
command:
|
|
|
|
|
- >
|
|
|
|
|
until pg_isready -h db -U postgres; do
|
|
|
|
|
echo "waiting for db…";
|
|
|
|
|
sleep 2;
|
|
|
|
|
done;
|
|
|
|
|
psql -h db -U postgres -d postgres -f /postgres-specific-migration.sql;
|
|
|
|
|
environment:
|
|
|
|
|
PGPASSWORD: postgres
|
|
|
|
|
restart: "no"
|
|
|
|
|
|
2025-04-20 16:06:23 +02:00
|
|
|
pgbouncer:
|
|
|
|
|
container_name: pgbouncer
|
|
|
|
|
image: edoburu/pgbouncer:latest
|
|
|
|
|
ports:
|
|
|
|
|
- "6432:6432"
|
|
|
|
|
restart: no
|
|
|
|
|
networks:
|
|
|
|
|
- ddon-psql-net
|
|
|
|
|
volumes:
|
|
|
|
|
- ./pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro
|
|
|
|
|
- ./userlist.txt:/etc/pgbouncer/userlist.txt:ro
|
|
|
|
|
environment:
|
|
|
|
|
- DB_USER=postgres
|
|
|
|
|
- DB_PASSWORD=postgres
|
|
|
|
|
depends_on:
|
|
|
|
|
- db
|