Настраиваемая через .env конфигурация
This commit is contained in:
@@ -3,17 +3,16 @@ services:
|
||||
image: postgres:17
|
||||
# container_name: pg-demo
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
# гарантируем UTF-8 и предсказуемую сортировку
|
||||
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
- "${PG_PORT:-5432}:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
- ./initdb:/docker-entrypoint-initdb.d:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
|
||||
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d postgres"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
Reference in New Issue
Block a user