version: "3.8"
services:
postgres:
image: postgres:15
command:
[
"postgres",
"--max_connections=200",
"--wal_level=minimal",
"--max_wal_senders=0",
"--port=5432"
]
environment:
- POSTGRES_PASSWORD={{password}}
networks:
- app_network
volumes:
- postgres_data:/var/lib/postgresql/data
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
resources:
limits:
cpus: "0.7"
memory: 1024M
volumes:
postgres_data:
external: true
networks:
app_network:
external: true