-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (102 loc) · 2.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
110 lines (102 loc) · 2.3 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
107
108
109
110
services:
nginx:
build: ./nginx
restart: unless-stopped
ports:
- "80:80"
depends_on:
- frontend
- backend
frontend:
build: ./frontend
restart: unless-stopped
backend:
build: ./backend
restart: unless-stopped
ports:
- "8000:8000"
volumes:
- ./backend:/app
env_file:
- .env
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/trcapp
- REDIS_URL=redis://redis:6379/0
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
depends_on:
migrate:
condition: service_completed_successfully
db:
condition: service_healthy
redis:
condition: service_started
rabbitmq:
condition: service_started
celery_worker:
build: ./backend
command: celery -A celery_app.celery worker --loglevel=info
restart: unless-stopped
volumes:
- ./backend:/app
env_file:
- .env
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/trcapp
- REDIS_URL=redis://redis:6379/0
depends_on:
migrate:
condition: service_completed_successfully
backend:
condition: service_started
rabbitmq:
condition: service_started
db:
image: postgres:14
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=trcapp
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7
restart: unless-stopped
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3-management
restart: unless-stopped
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics -q ping"]
interval: 10s
timeout: 5s
retries: 5
migrate:
build: ./backend
command: alembic upgrade head
env_file:
- .env
depends_on:
db:
condition: service_healthy
volumes:
postgres_data: