-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
101 lines (95 loc) · 2.43 KB
/
docker-compose.yml
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
98
99
100
101
services:
db:
image: postgres:16.6-alpine
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- db:/var/lib/postgresql/data
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 60s
timeout: 10s
retries: 5
start_period: 5s
start_interval: 5s
db-admin:
image: dpage/pgadmin4:8.14
environment:
# these credentials are public since this service is not exposed to public
# and used only for debugging purposes
- PGADMIN_DEFAULT_PASSWORD=pgadmin4
- PGADMIN_CONFIG_SERVER_MODE=False
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False
- PGADMIN_DISABLE_POSTFIX=True
ports:
- "8082:80"
depends_on:
db:
condition: service_healthy
profiles:
- debug
entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;"
user: root
configs:
- source: servers.json
target: /pgadmin4/servers.json
- source: pgpass
target: /pgpass
worker:
build:
dockerfile: worker.Dockerfile
context: .
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
restart: on-failure
depends_on:
db:
condition: service_healthy
restart: true
stop_signal: SIGINT
backend:
build:
dockerfile: backend.Dockerfile
context: .
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
- SECRET_KEY=${SECRET_KEY}
- DOMAIN_NAME=${DOMAIN_NAME}
restart: on-failure
depends_on:
db:
condition: service_healthy
restart: true
worker:
condition: service_started
proxy:
build:
dockerfile: proxy.Dockerfile
context: .
ports:
- 6916:6916
depends_on:
- backend
restart: on-failure
volumes:
db:
driver: local
configs:
pgpass:
content: db:5432:*:${POSTGRES_USER}:${POSTGRES_PASSWORD}
servers.json:
content: |
{"Servers": {"1": {
"Group": "Servers",
"Name": "PostgresDB",
"Host": "db",
"Port": 5432,
"MaintenanceDB": "${POSTGRES_DB}",
"Username": "${POSTGRES_USER}",
"PassFile": "/pgpass",
"SSLMode": "prefer"
}}}