-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.prod.yml
More file actions
152 lines (144 loc) · 3.97 KB
/
compose.prod.yml
File metadata and controls
152 lines (144 loc) · 3.97 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
services:
django-web:
build:
context: ./app
dockerfile: Dockerfile
container_name: django-web-prod
command: /app/entrypoint.prod.sh
env_file:
- .env.prod
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./static:/app/staticfiles
- ./media:/app/media
- /var/run/docker.sock:/var/run/docker.sock
group_add:
- "988"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
grobid:
condition: service_started
environment:
- HOST_PROJECT_PATH=${PWD}
- UV_CACHE_DIR=/tmp/uv-cache
- PYTHONUNBUFFERED=1
restart: unless-stopped
celery-worker:
build:
context: ./app
dockerfile: Dockerfile
container_name: celery-worker-prod
command: celery -A web worker --loglevel=info --concurrency=8 --max-tasks-per-child=1
env_file:
- .env.prod
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./static:/app/staticfiles
- ./media:/app/media
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
grobid:
condition: service_started
environment:
- UV_CACHE_DIR=/tmp/uv-cache
- PYTHONUNBUFFERED=1
- HOST_PROJECT_PATH=${PWD}
restart: unless-stopped
celery-beat:
build:
context: ./app
dockerfile: Dockerfile
container_name: celery-beat-prod
command: celery -A web beat --loglevel=info
env_file:
- .env.prod
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./static:/app/staticfiles
- ./media:/app/media
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
environment:
- UV_CACHE_DIR=/tmp/uv-cache
- PYTHONUNBUFFERED=1
- HOST_PROJECT_PATH=${PWD}
restart: unless-stopped
nginx:
image: nginx:latest
container_name: nginx-prod
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- ./static:/static
- ./media:/media
depends_on:
- django-web
restart: unless-stopped
mysql:
container_name: mysql-prod
image: mariadb:11.7
env_file:
- .env.prod
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- ./mysql_prod/lib:/var/lib/mysql
restart: unless-stopped
ports: []
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-h", "127.0.0.1", "-u", "healthcheck", "-phealthcheck"]
start_period: 5s
timeout: 5s
interval: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: redis-prod
restart: unless-stopped
volumes:
- redis-data-prod:/data
grobid:
image: grobid/grobid:0.8.2-crf
container_name: grobid-prod
init: true
expose:
- "8070"
ulimits:
core: 0
restart: unless-stopped
certbot:
image: certbot/certbot
container_name: certbot-prod
entrypoint: ""
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
command: sh -c "certbot certonly --webroot -w /var/www/certbot --email your-email@example.com -d paper-snitch.ing.unimore.it -d www.paper-snitch.ing.unimore.it --agree-tos --non-interactive && certbot certonly --webroot -w /var/www/certbot --email your-email@example.com -d paper-snitch.online -d www.paper-snitch.online --agree-tos --non-interactive"
certbot-renew:
image: certbot/certbot
container_name: certbot-renew-prod
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
volumes:
redis-data-prod: