File: docker-compose.yml

package info (click to toggle)
pg-auto-failover 2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,368 kB
  • sloc: ansic: 58,369; python: 5,515; sql: 3,177; makefile: 629; sh: 35
file content (97 lines) | stat: -rw-r--r-- 2,185 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
x-coord: &coordinator
  image: pg_auto_failover:citus
  environment:
    PGDATA: /tmp/pgaf
    PGUSER: citus
    PGDATABASE: citus
    PG_AUTOCTL_HBA_LAN: true
    PG_AUTOCTL_AUTH_METHOD: "trust"
    PG_AUTOCTL_SSL_SELF_SIGNED: true
    PG_AUTOCTL_MONITOR: "postgresql://autoctl_node@monitor/pg_auto_failover"
  expose:
    - 5432

x-worker: &worker
  image: pg_auto_failover:citus
  environment:
    PGDATA: /tmp/pgaf
    PGUSER: citus
    PGDATABASE: citus
    PG_AUTOCTL_HBA_LAN: true
    PG_AUTOCTL_AUTH_METHOD: "trust"
    PG_AUTOCTL_SSL_SELF_SIGNED: true
    PG_AUTOCTL_MONITOR: "postgresql://autoctl_node@monitor/pg_auto_failover"
  expose:
    - 5432

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile.app
    environment:
      PGUSER: citus
      PGDATABASE: citus
      PGHOST: coord0a,coord0b
      PGPORT: 5432
      PGAPPNAME: demo
      PGSSLMODE: require
      PGTARGETSESSIONATTRS: read-write

  monitor:
    image: pg_auto_failover:citus
    environment:
      PGDATA: /tmp/pgaf
      PG_AUTOCTL_SSL_SELF_SIGNED: true
    expose:
      - 5432
    command: |
      pg_autoctl create monitor --auth trust --run

  coord0a:
    <<: *coordinator
    hostname: coord0a
    command: |
      pg_autoctl create coordinator --name coord0a --run

  coord0b:
    <<: *coordinator
    hostname: coord0b
    command: |
      pg_autoctl create coordinator --name coord0b --run

  worker1a:
    <<: *worker
    hostname: worker1a
    command: |
      pg_autoctl create worker --group 1 --name worker1a --run

  worker1b:
    <<: *worker
    hostname: worker1b
    command: |
      pg_autoctl create worker --group 1 --name worker1b --run

  worker2a:
    <<: *worker
    hostname: worker2a
    command: |
      pg_autoctl create worker --group 2 --name worker2a --run

  worker2b:
    <<: *worker
    hostname: worker2b
    command: |
      pg_autoctl create worker --group 2 --name worker2b --run

  worker3a:
    <<: *worker
    hostname: worker3a
    command: |
      pg_autoctl create worker --group 3 --name worker3a --run

  worker3b:
    <<: *worker
    hostname: worker3b
    command: |
      pg_autoctl create worker --group 3 --name worker3b --run