24 lines
785 B
YAML
24 lines
785 B
YAML
services:
|
|
postgres:
|
|
container_name: $APP_NAME-postgres
|
|
image: postgres:14
|
|
restart: always
|
|
environment:
|
|
- POSTGRES_DB=${POSTGRES_DB:-$APP_NAME}
|
|
- POSTGRES_USER=${POSTGRES_USER:-$ROOT_USER}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-$ROOT_PASSWORD}
|
|
- POSTGRES_NON_ROOT_USER=${POSTGRES_NON_ROOT_USER:-$ADMIN_USER}
|
|
- POSTGRES_NON_ROOT_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD:-$ADMIN_PASSWORD}
|
|
volumes:
|
|
- postgres_storage:/var/lib/postgresql/data
|
|
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
|
healthcheck:
|
|
test:
|
|
[
|
|
'CMD-SHELL',
|
|
'pg_isready -h localhost -U ${POSTGRES_USER:-$ROOT_USER} -d ${POSTGRES_DB:-$APP_NAME}',
|
|
]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|