34 lines
621 B
YAML
34 lines
621 B
YAML
services:
|
|
postgres:
|
|
image: postgres:18
|
|
container_name: postgres
|
|
restart: always
|
|
healthcheck:
|
|
interval: 30s
|
|
retries: 5
|
|
start_period: 20s
|
|
test:
|
|
- CMD-SHELL
|
|
- pg_isready -U $${POSTGRES_USER_FILE}
|
|
timeout: 5s
|
|
env_file:
|
|
- .env
|
|
secrets:
|
|
- POSTGRES_USER
|
|
- POSTGRES_PASS
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql
|
|
networks:
|
|
- backend
|
|
volumes:
|
|
pgdata:
|
|
name: pgdata
|
|
secrets:
|
|
POSTGRES_USER:
|
|
file: ./.secrets/POSTGRES_USER
|
|
POSTGRES_PASS:
|
|
file: ./.secrets/POSTGRES_PASS
|
|
networks:
|
|
backend:
|
|
external:
|
|
true |