2022-10-20 15:30:07 +02:00
|
|
|
services:
|
2022-10-20 15:41:56 +02:00
|
|
|
postgres:
|
2022-10-20 19:12:33 +02:00
|
|
|
container_name: $APP_NAME-postgres
|
2022-10-20 23:07:28 +02:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile
|
2022-10-20 15:30:07 +02:00
|
|
|
restart: always
|
|
|
|
environment:
|
2022-10-21 16:49:58 +02:00
|
|
|
- POSTGRES_DB=${POSTGRES_DB:-postgres}
|
|
|
|
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
2022-10-20 19:12:33 +02:00
|
|
|
- POSTGRES_NON_ROOT_USER=${POSTGRES_NON_ROOT_USER:-$ADMIN_USER}
|
2022-10-21 16:49:58 +02:00
|
|
|
- POSTGRES_NON_ROOT_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD:-$POSTGRES_PASSWORD}
|
2022-10-20 15:30:07 +02:00
|
|
|
volumes:
|
2022-10-20 15:41:56 +02:00
|
|
|
- postgres_storage:/var/lib/postgresql/data
|
2022-10-20 15:30:07 +02:00
|
|
|
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
|
|
|
healthcheck:
|
|
|
|
test:
|
|
|
|
[
|
|
|
|
'CMD-SHELL',
|
2022-10-21 16:49:58 +02:00
|
|
|
'pg_isready -h localhost -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}',
|
2022-10-20 15:30:07 +02:00
|
|
|
]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 10
|