forked from pneumaticapp/pneumaticworkflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·170 lines (161 loc) · 3.89 KB
/
docker-compose.yml
File metadata and controls
executable file
·170 lines (161 loc) · 3.89 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: pneumatic
services:
postgres:
image: postgres:15-bookworm
container_name: pneumatic-postgres
env_file:
- ./config/postgres.env
volumes:
- ./postgres/data:/var/lib/postgresql/data:rw
- ./postgres/backups:/backups:rw
expose:
- 5432
networks:
- pneumatic
restart: always
redis:
# Newest version not working on old linux kernels
image: redis:6.2.6
container_name: pneumatic-redis
command: >
redis-server
--loglevel warning
--databases 16
--dbfilename dump.rdb
--dir /data
--requirepass redis_password
--save 20 1 300 100 60 10000
volumes:
- ./redis/data:/data
expose:
- 6379
networks:
- pneumatic
restart: always
rabbitmq:
container_name: pneumatic-rabbitmq
image: rabbitmq:3.13-management
expose:
- 5672 # broker url
ports:
- 15672:15672 # admin panel
volumes:
- ./rabbitmq/data/:/var/lib/rabbitmq/
- ./rabbitmq/log/:/var/log/rabbitmq
env_file:
- ./config/rabbitmq.env
networks:
- pneumatic
backend:
build:
context: ./backend
container_name: pneumatic-backend
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --no-input &&
python manage.py compilemessages &&
gunicorn src.asgi:application --workers 2 -k uvicorn.workers.UvicornWorker --worker-tmp-dir /dev/shm --bind unix:/tmp/gunicorn/pneumatic-backend.sock --timeout 200"
env_file:
- ./config/project.env
- ./config/postgres.env
- ./config/backend.env
volumes:
- ./backend:/pneumatic_backend
- backend-socket:/tmp/gunicorn
- backend-staticfiles:/pneumatic_backend/staticfiles
depends_on:
- postgres
- rabbitmq
- redis
healthcheck:
test: ["CMD", "pg_isready", "-h", postgres]
interval: 5s
timeout: 5s
retries: 10
networks:
- pneumatic
restart: always
celery:
build:
context: ./backend
container_name: pneumatic-celery
env_file:
- ./config/project.env
- ./config/postgres.env
- ./config/backend.env
volumes:
- ./backend:/pneumatic_backend
command: >
sh -c "celery -A src worker -l warning"
depends_on:
- postgres
- rabbitmq
- redis
networks:
- pneumatic
restart: always
celery-beat:
build:
context: ./backend
container_name: pneumatic-celery-beat
env_file:
- ./config/project.env
- ./config/postgres.env
- ./config/backend.env
volumes:
- ./backend:/pneumatic_backend
command: celery --pidfile= -A src beat -l warning -S django
depends_on:
- postgres
- rabbitmq
- redis
networks:
- pneumatic
restart: always
frontend:
build:
context: ./frontend
container_name: pneumatic-frontend
env_file:
- ./config/project.env
- ./config/frontend.env
command: >
sh -c "npm run build-client:prod && pm2-runtime start pm2.json"
expose:
- 8000
volumes:
- ./frontend:/pneumatic_frontend
networks:
- pneumatic
restart: always
nginx:
build:
context: ./nginx
container_name: pneumatic-nginx
env_file:
- ./config/project.env
environment:
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx/
- NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/templates
volumes:
- ./nginx/logs/:/var/log/nginx/
- ./nginx/keys/:/etc/keys/:ro
- ./nginx/www/:/var/www/:ro
- ./nginx/templates/:/etc/nginx/templates
- backend-socket:/tmp/gunicorn/
- backend-staticfiles:/tmp/backend-staticfiles/
ports:
- 80:80
- 443:443
- 8001:8001
networks:
- pneumatic
depends_on:
- backend
- frontend
restart: always
networks:
pneumatic:
volumes:
backend-staticfiles:
backend-socket: