forked from djangoindia/djangoindia.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.yml
93 lines (86 loc) · 2.04 KB
/
production.yml
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
services:
backend: &backend
build:
context: ./backend
dockerfile: Dockerfile.prod
container_name: djangoindia-backend
volumes:
- logs:/app/logs
depends_on:
- postgres
# - rabbitmq
ports:
- "8000:8000"
env_file:
- .env.production
environment:
- DJANGO_SETTINGS_MODULE=djangoindia.settings.production
command: /start-prod
worker:
<<: *backend
container_name: worker
command: celery -A djangoindia worker -l info
ports: []
depends_on:
- backend
- postgres
- rabbitmq
postgres:
image: postgres:14.1-alpine
container_name: postgres
env_file:
- .env.production
volumes:
- postgres:/var/lib/postgresql/data
expose:
- 5432
# frontend:
# build:
# context: ./frontend
# dockerfile: Dockerfile.prod
# container_name: frontend
# volumes:
# - ./frontend:/app/frontend
# depends_on:
# - backend
# - postgres
# env_file:
# - frontend/.env
# ports:
# - "3000:3000"
nginx:
build:
context: ./nginx
dockerfile: dockerfile.nginx
container_name: nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- nginx_logs:/var/log/nginx
ports:
- "80:80"
- "443:443"
depends_on:
- backend
restart: always
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- "5672:5672" # RabbitMQ default port
- "15672:15672" # Management UI port
volumes:
logs:
nginx_logs:
postgres:
# frontend:
certbot_conf:
certbot_www: