Настраиваемая через .env конфигурация

This commit is contained in:
2025-09-14 23:25:38 +03:00
parent 09dd1bdcb0
commit c23512920b
+4 -5
View File
@@ -3,17 +3,16 @@ services:
image: postgres:17 image: postgres:17
# container_name: pg-demo # container_name: pg-demo
environment: environment:
POSTGRES_USER: postgres POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
# гарантируем UTF-8 и предсказуемую сортировку
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8" POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8"
ports: ports:
- "5432:5432" - "${PG_PORT:-5432}:5432"
volumes: volumes:
- pgdata:/var/lib/postgresql/data - pgdata:/var/lib/postgresql/data
- ./initdb:/docker-entrypoint-initdb.d:ro - ./initdb:/docker-entrypoint-initdb.d:ro
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"] test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d postgres"]
interval: 5s interval: 5s
timeout: 5s timeout: 5s
retries: 20 retries: 20