-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
75 lines (70 loc) · 1.51 KB
/
docker-compose.yaml
File metadata and controls
75 lines (70 loc) · 1.51 KB
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
---
services:
postgres:
image: postgres:latest
ports:
- "5432:5432"
env_file:
- .env
networks:
- postgres-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 20s
timeout: 5s
retries: 3
init-1:
image: cg5labs/py_api:latest
user: "tdevops"
entrypoint: "/srv/app/generate_key"
environment:
SECRET_KEY: "/srv/app/app-data/secret.key"
volumes:
- app-data:/srv/app/app-data:rw
depends_on:
- postgres
init-2:
image: cg5labs/py_api:latest
user: "tdevops"
entrypoint: "/srv/app/db_init"
environment:
SECRET_KEY: "/srv/app/app-data/secret.key"
PROFILE: "DEFAULT"
DB_HOST: "postgres"
env_file:
- src/.env
volumes:
- app-data:/srv/app/app-data:rw
depends_on:
postgres:
condition: service_healthy
init-1:
condition: service_completed_successfully
networks:
- postgres-network
api:
image: cg5labs/py_api:latest
user: "tdevops"
# entrypoint: "/bin/sleep 3600"
entrypoint:
- "/srv/app/app_init"
- "-p DEFAULT"
environment:
SECRET_KEY: /srv/app/app-data/secret.key
PROFILE: "DEFAULT"
DB_HOST: "postgres"
env_file:
- src/.env
ports:
- "8000:8000"
depends_on:
- init-2
volumes:
- app-data:/srv/app/app-data
networks:
- postgres-network
networks:
postgres-network:
driver: bridge
volumes:
app-data: