-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
106 lines (97 loc) · 2.54 KB
/
docker-compose.yaml
File metadata and controls
106 lines (97 loc) · 2.54 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
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
102
103
104
105
106
x-shared-web-parameters: &x-shared-web-parameters
build:
context: ./
dockerfile: Dockerfile
target: web-runtime
env_file: .env
networks:
- auth_network
services:
auth.web:
container_name: auth-web
<<: *x-shared-web-parameters
command: ["sh", "-c", "auth-web start-uvicorn"]
restart: unless-stopped
depends_on:
auth.migrator:
condition: service_completed_successfully
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:${SERVER_PORT}/auth/healthcheck || exit 1" ]
start_period: 15s
interval: 10s
timeout: 5s
retries: 5
ports:
- "7000:${SERVER_PORT}"
auth.migrator:
container_name: auth-migrator
<<: *x-shared-web-parameters
command: ["sh", "-c", "auth-web migrate"]
restart: no
depends_on:
auth.db:
condition: service_healthy
auth.worker:
container_name: auth-worker
build:
context: ./
dockerfile: Dockerfile
target: worker-runtime
command: ["sh", "-c", "auth-worker start-worker"]
restart: unless-stopped
env_file: .env
networks:
- auth_network
depends_on:
auth.web:
condition: service_healthy
auth.rabbitmq:
condition: service_healthy
auth.db:
container_name: auth-db
image: postgres:17.4-alpine
env_file: .env
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /data/postgres
volumes:
- pg_data:/data/postgres
- ./scripts/db-initializer.sh:/docker-entrypoint-initdb.d/db-initializer.sh
networks:
- auth_network
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER}" ]
interval: 5s
timeout: 5s
retries: 5
auth.rabbitmq:
container_name: auth-rabbitmq
image: rabbitmq:4.1.0-alpine
env_file: .env
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: ${RABBIT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBIT_PASSWORD}
RABBITMQ_NODE_PORT: ${RABBIT_PORT}
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: -rabbit log_levels [{connection,error},{default,error}] disk_free_limit 2147483648
volumes:
- rabbitmq_data:/var/lib/rabbitmq
networks:
- auth_network
ports:
- "${RABBIT_PORT}:${RABBIT_PORT}"
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics -q ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
auth_network:
driver: bridge
volumes:
pg_data:
rabbitmq_data: