server-origin/postgres.yml
2024-06-23 10:22:15 +05:00

22 lines
712 B
YAML

services:
postgres:
container_name: postgres
image: postgres:16.3-alpine3.19
restart: always
networks:
- proxynet
env_file:
- ./secrets/vars.env
environment:
PG_DATA: /var/lib/postgresql/data
POSTGRES_USER: admin
POSTGRES_DB: postgres
volumes:
- ./data/pgdata:/var/lib/postgresql/data
#- ./init-db:/docker-entrypoint-initdb.d
- ./init-db/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.postgresql.rule=HostSNI(`*`)"
- "traefik.tcp.services.postgresql.loadbalancer.server.port=5432"
- "traefik.tcp.routers.postgresql.entrypoints=postgres"