Advertisement
Azamatik

Docker Compose For Backup

May 20th, 2024
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.94 KB | None | 0 0
  1. services:
  2.   main:
  3.     image: postgres:14.1-alpine
  4.     container_name: main
  5.     restart: always
  6.     environment:
  7.       POSTGRES_DB: "users"
  8.       POSTGRES_USER: "dev_user"
  9.       POSTGRES_PASSWORD: "password12345"
  10.     ports:
  11.      - '5432:5432'
  12.     volumes:
  13.       - main:/var/lib/postgresql/data
  14.     healthcheck:
  15.       test: ["CMD-SHELL", "pg_isready -q --dbname=users --user=dev_user --host=localhost --port=5432"]
  16.       interval: 3s
  17.       timeout: 1s
  18.       retries: 30
  19.  
  20.   restored:
  21.     image: postgres:14.1-alpine
  22.     container_name: restored
  23.     restart: always
  24.     environment:
  25.       POSTGRES_DB: "users"
  26.       POSTGRES_USER: "dev_user"
  27.       POSTGRES_PASSWORD: "password12345"
  28.     ports:
  29.      - '5433:5432'
  30.     healthcheck:
  31.       test: ["CMD-SHELL", "pg_isready -q --dbname=users --user=dev_user --host=localhost --port=5432"]
  32.       interval: 3s
  33.       timeout: 1s
  34.       retries: 30
  35.  
  36. volumes:
  37.   main:
  38.     driver: local
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement