Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3.5'
- networks:
- webapp:
- driver: overlay
- name: webapp
- services:
- primary:
- hostname: 'primary'
- image: crunchydata/crunchy-postgres:centos7-9.6.11-2.2.0
- environment:
- - PGHOST=/tmp
- - MAX_CONNECTIONS=10
- - MAX_WAL_SENDERS=5
- - PG_MODE=primary
- - PG_PRIMARY_USER=primaryuser
- - PG_PRIMARY_PASSWORD=primarypassword
- - PG_DATABASE=testdb
- - PG_USER=pguser
- - PG_PASSWORD=pgpassword
- - PG_ROOT_PASSWORD=longsecretpassword
- - PG_PRIMARY_PORT=5432
- volumes:
- - pg-primary-vol:/pgdata
- ports:
- - "5432"
- networks:
- - webapp
- deploy:
- restart_policy:
- condition: on-failure
- delay: 10s
- max_attempts: 4
- window: 300s
- healthcheck:
- test: ["CMD-SHELL", "/usr/pgsql-9.6/bin/pg_isready -U postgres"]
- interval: 10s
- timeout: 5s
- retries: 5
- start_period: 2m
- replica:
- image: crunchydata/crunchy-postgres:centos7-9.6.11-2.2.0
- environment:
- - PGHOST=/tmp
- - MAX_CONNECTIONS=10
- - MAX_WAL_SENDERS=5
- - PG_MODE=replica
- - PG_PRIMARY_HOST=primary
- - PG_PRIMARY_PORT=5432
- - PG_PRIMARY_USER=primaryuser
- - PG_PRIMARY_PASSWORD=primarypassword
- - PG_DATABASE=testdb
- - PG_USER=testuser
- - PG_PASSWORD=password
- - PG_ROOT_PASSWORD=Pje5SXan7qHa9LFL3nmYCUBgwR6EHtF6K4qKnvfd
- volumes:
- - pg-replica-vol:/pgdata
- ports:
- - "5432"
- networks:
- - webapp
- deploy:
- restart_policy:
- condition: on-failure
- delay: 10s
- max_attempts: 4
- window: 300s
- healthcheck:
- test: ["CMD-SHELL", "/usr/pgsql-9.6/bin/pg_isready -U postgres"]
- interval: 10s
- timeout: 5s
- retries: 5
- start_period: 30s
- depends_on:
- - pg-primary
- volumes:
- pg-primary-vol:
- pg-replica-vol:
Advertisement
Add Comment
Please, Sign In to add comment