-
Notifications
You must be signed in to change notification settings - Fork 18
/
docker-compose.yml
126 lines (116 loc) · 3.19 KB
/
docker-compose.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
version: '3.6'
x-build-args: &build_args
INSTALL_PYTHON_VERSION: 3.8.2
INSTALL_NODE_VERSION: 12
x-default-volumes: &default_volumes
volumes:
- ./:/app
- node-modules:/app/node_modules
services:
web:
build:
context: .
dockerfile: Dockerfile_production
target: production
args:
<<: *build_args
command: gunicorn -b :5000 -w ${GUNICORN_WORKERS} -k gevent 'airscore.app:create_app()'
image: master-image
container_name: ${FLASK_CONTAINER}
ports:
- "5000:5000"
environment:
REDIS_CONTAINER: ${REDIS_CONTAINER}
WEB_SERVER_CONTAINER: ${WEB_SERVER_CONTAINER}
FLASK_CONTAINER: ${FLASK_CONTAINER}
FLASK_PORT: ${FLASK_PORT}
REDIS_URL: redis://${REDIS_CONTAINER}:6379
FLASK_ENV: production
FLASK_DEBUG: 0
LOG_LEVEL: info
GUNICORN_WORKERS: ${GUNICORN_WORKERS}
RQ_QUEUE: ${RQ_QUEUE}
MAIL_SERVER: ${MAIL_SERVER}
MAIL_PORT: ${MAIL_PORT}
MAIL_USE_TLS: ${MAIL_USE_TLS}
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
ADMINS: ${ADMINS}
MYSQLHOST: ${MYSQLHOST}
DATABASE: ${DATABASE}
MYSQLUSER: ${MYSQLUSER}
MYSQLPASSWORD: ${MYSQLPASSWORD}
DATABASE_URI: mysql+pymysql://${MYSQLUSER}:${MYSQLPASSWORD}@${MYSQLHOST}/${DATABASE}
XCONTEST_USER: ${XCONTEST_USER}
XCONTEST_PASS: ${XCONTEST_PASS}
TELEGRAM_API: ${TELEGRAM_API}
TELEGRAM_CHANNEL: ${TELEGRAM_CHANNEL}
networks:
- net
restart: always
<<: *default_volumes
worker:
image: master-image
depends_on:
- redis
command: rqworker --with-scheduler --name worker --url redis://${REDIS_CONTAINER}:6379/0 ${RQ_QUEUE}
environment:
FLASK_CONTAINER: ${FLASK_CONTAINER}
FLASK_PORT: ${FLASK_PORT}
REDIS_URL: redis://${REDIS_CONTAINER}:6379
RQ_QUEUE: ${RQ_QUEUE}
MAIL_SERVER: ${MAIL_SERVER}
MAIL_PORT: ${MAIL_PORT}
MAIL_USE_TLS: ${MAIL_USE_TLS}
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
MYSQLHOST: ${MYSQLHOST}
DATABASE: ${DATABASE}
MYSQLUSER: ${MYSQLUSER}
MYSQLPASSWORD: ${MYSQLPASSWORD}
DATABASE_URI: mysql+pymysql://${MYSQLUSER}:${MYSQLPASSWORD}@${MYSQLHOST}/${DATABASE}
XCONTEST_USER: ${XCONTEST_USER}
XCONTEST_PASS: ${XCONTEST_PASS}
TELEGRAM_API: ${TELEGRAM_API}
TELEGRAM_CHANNEL: ${TELEGRAM_CHANNEL}
networks:
- net
<<: *default_volumes
# uncomment to have a another worker
# worker2:
# image: master-image
# depends_on:
# - redis
# command: rqworker --name worker2 --url redis://redis:6379/0
redis:
image: redis
container_name: ${REDIS_CONTAINER}
networks:
- net
nginx:
container_name: ${WEB_SERVER_CONTAINER}
restart: always
build: ./nginx
ports:
- "80:80"
depends_on:
- web
networks:
- net
volumes:
- type: bind
source: ./airscore/static
target: /static
volumes:
node-modules:
static-build:
networks:
net:
#
# dashboard:
# image: master-image
# ports:
# - 5555:5555
# depends_on:
# - redis
# command: rq-dashboard --port 5555 --redis-url redis://redis:6379/0