-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.production.yml
131 lines (117 loc) · 3.22 KB
/
docker-compose.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
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
version: "2"
services:
db:
image: postgres:12
volumes:
- ./motivo_postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- private
django:
build:
dockerfile: ./Dockerfile
context: .
command: bash -c "apt-get update; python manage.py migrate; python manage.py setup_categories; python manage.py collectstatic --noinput ; gunicorn practice.wsgi:application --log-file - --bind 0.0.0.0:8000"
volumes:
- ./uploads:/code/uploads
- ./app/practice/static:/static
depends_on:
- db
expose:
- 8000
# stdin_open: true
# tty: true
restart: on-failure
networks:
- private
- traefik_webgateway
environment:
- VIRTUAL_HOST=${API_HOST}
- LETSENCRYPT_HOST=${API_HOST}
- LETSENCRYPT_EMAIL=${USER_LETSENCRYPT_EMAIL}
- VIRTUAL_PORT=8000
nginx_django:
container_name: ${CONTAINER_NAME}_nginx_django
build:
dockerfile: ./Nginx.Dockerfile
context: .
volumes:
# - .:/code
- ./app/practice/static:/static
depends_on:
- django
networks:
- private
- nginx-proxy
restart: "on-failure"
environment:
- VIRTUAL_HOST=${STATIC_URL}
- LETSENCRYPT_HOST=${STATIC_URL}
- LETSENCRYPT_EMAIL=${USER_LETSENCRYPT_EMAIL}
frontend:
container_name: ${CONTAINER_NAME}_frontend
build:
dockerfile: ./Frontend.Dockerfile
context: .
depends_on:
- django
networks:
- private
- nginx-proxy
cap_add:
- SYS_PTRACE
privileged: true
environment:
- VIRTUAL_HOST=${HOST}
- LETSENCRYPT_HOST=${HOST}
- LETSENCRYPT_EMAIL=${USER_LETSENCRYPT_EMAIL}
rabbitmq:
image: rabbitmq:management-alpine
hostname: rabbitmq
restart: on-failure
networks:
- private
celery_worker:
build:
dockerfile: ./Dockerfile
context: .
command: celery -A practice worker -l info --max-tasks-per-child=1
environment:
- DJANGO_SETTINGS_MODULE=practice.settings
# volumes:
# - .:/code
restart: on-failure
depends_on:
- django
- db
- rabbitmq
networks:
- private
celery_beat:
build:
dockerfile: ./Dockerfile
context: .
command: celery -A practice beat -l info
environment:
- DJANGO_SETTINGS_MODULE=practice.settings
# volumes:
# - .:/code
depends_on:
- django
- db
- rabbitmq
restart: on-failure
networks:
- private
networks:
traefik_webgateway:
external: true
private:
driver: bridge
volumes:
redis:
motivo_postgres:
external: true