diff --git a/stacks/core/postgres/stack.yml b/stacks/core/postgres/stack.yml new file mode 100644 index 0000000..b899df5 --- /dev/null +++ b/stacks/core/postgres/stack.yml @@ -0,0 +1,27 @@ +services: + postgres: + image: postgres:17-alpine + secrets: + - postgres-master + networks: + - homelab + environment: + - POSTGRES_USER=admin + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres-master + - PGDATA=/var/lib/postgresql/data + volumes: + - /mnt/swarm-data/postgres:/var/lib/postgresql/data + ports: + - 5432:5432 + deploy: + replicas: 1 + placement: + constraints: + - node.hostname == p0 + +networks: + homelab: + external: true +secrets: + postgres-master: + external: true \ No newline at end of file