32 lines
754 B
YAML
32 lines
754 B
YAML
services:
|
|
postgres:
|
|
image: postgres:18
|
|
container_name: postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
# POSTGRES_PASSWORD_FILE: /run/secrets/POSTGRES_PASSWORD
|
|
POSTGRES_INITDB_ARGS: "--data-checksums --locale=C --encoding=UTF8 --auth-host=scram-sha-256"
|
|
POSTGRES_HOST_AUTH_METHOD: "scram-sha-256"
|
|
TZ: Europe/Minsk
|
|
networks:
|
|
- postgres
|
|
ports:
|
|
- "127.0.0.1:5432:5432"
|
|
volumes:
|
|
- /srv/postgres18:/var/lib/postgresql
|
|
# secrets:
|
|
# - POSTGRES_PASSWORD
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
#secrets:
|
|
# POSTGRES_PASSWORD:
|
|
# file: ./POSTGRES_PASSWORD
|
|
|
|
networks:
|
|
postgres:
|
|
name: postgres
|