-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
99 lines (93 loc) · 2.04 KB
/
docker-compose.yaml
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
# Run PostgreSQL for testing with a local development server.
# This is used by make run, which starts cm-service in the foreground.
name: "${USER}-cm-service"
services:
init-db:
profiles:
- full
- server
- daemon
build:
context: .
dockerfile: docker/Dockerfile
target: cmservice
entrypoint:
- alembic
command:
- upgrade
- head
environment: &cmenv
DB__HOST: postgresql
DB__ECHO: true
DB__URL: postgresql://cm-service@postgresql:5432/cm-service
DB__PASSWORD: INSECURE-PASSWORD
DB__TABLE_SCHEMA: public
networks:
- cmservice
depends_on:
postgresql:
condition: service_healthy
cmservice:
profiles:
- full
- server
build:
context: .
dockerfile: docker/Dockerfile
target: cmservice
env_file:
- path: .env
required: false
environment: *cmenv
ports:
- "8080:8080"
networks:
- cmservice
depends_on:
init-db:
condition: service_completed_successfully
cmworker:
profiles:
- full
- worker
build:
context: .
dockerfile: docker/Dockerfile
target: cmworker
env_file:
- path: .env
required: false
environment: *cmenv
volumes:
- "./prod_area:/prod_area"
networks:
- cmservice
depends_on:
init-db:
condition: service_completed_successfully
postgresql:
image: "postgres:16"
hostname: "postgresql"
environment:
POSTGRES_PASSWORD: "INSECURE-PASSWORD"
POSTGRES_USER: "cm-service"
POSTGRES_DB: "cm-service"
ports:
- "65432:5432"
networks:
- cmservice
volumes:
- "pgsql:/var/lib/postgresql/data"
healthcheck:
test: >-
psql postgresql://cm-service:[email protected]/cm-service
--quiet --no-align --tuples-only -1 --command="SELECT 1"
interval: 1s
timeout: 1s
retries: 30
start_period: 1s
volumes:
pgsql:
networks:
cmservice:
driver: bridge