-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (95 loc) · 2.18 KB
/
docker-compose.yml
File metadata and controls
101 lines (95 loc) · 2.18 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
version: "3.9"
volumes:
test-data:
certbot-etc:
certbot-var:
webroot:
services:
celery-worker:
build:
context: .
dockerfile: api/Dockerfile
depends_on:
- redis
command: >
celery -A api.services.test_processor.celery_app
worker --loglevel=warning --concurrency=2 --max-memory-per-child=512000
volumes:
- test-data:/data
env_file:
- ./api/.env
environment:
SHARED_DATA_DIR: /data
restart: always
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
core:
build:
context: .
dockerfile: api/Dockerfile
volumes:
- test-data:/data
ports:
- "5328:5328"
env_file:
- ./api/.env
environment:
SHARED_DATA_DIR: /data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5328/health"]
interval: 30s
timeout: 5s
retries: 3
depends_on:
- redis
- celery-worker
nextjs:
build:
context: .
dockerfile: Dockerfile.nextjs
args:
FASTAPI_URL: http://core:5328
ports:
- "3000:3000"
env_file:
- .env.production
depends_on:
- core
- redis
nginx:
image: nginx:1.25-alpine
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/snippets:/etc/nginx/snippets:ro
- webroot:/var/www/html:rw
- certbot-etc:/etc/letsencrypt:ro
- certbot-var:/var/lib/letsencrypt:rw
ports:
- "80:80"
- "443:443"
command: "/bin/sh -c 'nginx -g \"daemon off;\"'"
depends_on:
- nextjs
- core
restart: unless-stopped
certbot:
image: certbot/certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- webroot:/var/www/html
command: certonly --webroot --webroot-path=/var/www/html --register-unsafely-without-email --agree-tos --no-eff-email --force-renewal -n -d 45.144.167.21.sslip.io
depends_on:
- nginx
networks:
default:
name: app-network
driver: bridge