forked from frg-fossee/eSim-Cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
148 lines (132 loc) · 3.43 KB
/
docker-compose.prod.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: '3'
services:
nginx:
image: nginx
ports:
- 80:80
volumes:
- tmp_vol:/tmp
- ./Nginx/conf.d:/etc/nginx/conf.d
- ./Nginx/static_pages:/usr/share/nginx/static_pages
- ./eda-frontend/build:/usr/share/nginx/eda
- ./ArduinoFrontend/dist:/usr/share/nginx/arduino-build
- ./esim-cloud-backend/static:/usr/share/nginx/django_static
- ./esim-cloud-backend/file_storage:/usr/share/nginx/django_file_storage
- ./esim-cloud-backend/kicad-symbols/:/usr/share/nginx/kicad-libs
depends_on:
- django
- eda-frontend
- arduino-frontend
eda-frontend:
image: "docker.pkg.github.com/frg-fossee/esim-cloud/eda-frontend:master"
build: ./eda-frontend/
command: >
sh -c "npm install &&
npm run build"
environment:
- "PUBLIC_URL=${EDA_PUBLIC_URL}"
volumes:
- ./eda-frontend:/code
arduino-frontend:
image: "docker.pkg.github.com/frg-fossee/esim-cloud/arduino-frontend:master"
build: ./ArduinoFrontend/
command: >
sh -c "npm install &&
npm run ng -- build --prod --aot --base-href ${ARDUINO_BASE_HREF}"
# environment:
# - NODE_ENV=production
volumes:
- ./ArduinoFrontend:/code
django:
image: "docker.pkg.github.com/frg-fossee/esim-cloud/django:master"
build: ./esim-cloud-backend/
command: >
sh -c "gunicorn -w ${GUNICORN_WORKERS} --reload -b 0.0.0.0:8000 --log-level info esimCloud.wsgi"
volumes:
- ./esim-cloud-backend:/code
- run_vol:/var/run
- cache_vol:/var/cache
- tmp_vol:/tmp
depends_on:
- redis
- db
- celery
- mongodb
env_file:
- .env.prod
environment:
- DJANGO_DEBUG=False
links:
- "redis:redis"
- "db:db"
- "mongodb:mongodb"
celery:
image: "docker.pkg.github.com/frg-fossee/esim-cloud/celery:master"
build: ./esim-cloud-backend/
command: "celery -A esimCloud.celery worker -l info --concurrency=${CELERY_WORKERS}"
links:
- "redis:redis_cache"
- "db:postgres"
env_file:
- .env.prod
environment:
- DJANGO_DEBUG=False
volumes:
- ./esim-cloud-backend:/code
- run_vol:/var/run
- cache_vol:/var/cache
- tmp_vol:/tmp
depends_on:
- redis
- db
- mongodb
links:
- "redis:redis"
- "db:db"
- "mongodb:mongodb"
deploy:
replicas: 3
mongodb:
image: "mongo:${TAG_MONGO}"
environment:
- MONGO_DATA_DIR=/usr/data/db/
- MONGO_LOG_DIR=/dev/null
volumes:
- ./mongo_data:/usr/data/db
env_file:
- .env.prod
command: mongod
redis:
image: "redis:${TAG_REDIS}"
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
volumes:
- ./redis_data:/data
# Uncomment this and Change appropriate env variables to switch to mysql
# db:
# image: "mysql:${TAG_MYSQL}"
# command: --default-authentication-plugin=mysql_native_password
# env_file:
# - .env.prod
# volumes:
# - ./mysql_data:/var/lib/mysql
db:
image: postgres
volumes:
- ./postgres_data:/var/lib/postgresql/data/
env_file:
- .env.prod
volumes:
run_vol:
driver_opts:
type: tmpfs
device: tmpfs
cache_vol:
driver_opts:
type: tmpfs
device: tmpfs
tmp_vol:
driver_opts:
type: tmpfs
device: tmpfs