-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.single.yml
executable file
·66 lines (61 loc) · 1.57 KB
/
docker-compose.single.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
version: '3'
services:
probe:
image: trolleksii/ansible_db_probe
depends_on:
- citizen_db
environment:
- PROBE_HOST=citizen_db
- PROBE_PORT=5432
citizen_db:
image: postgres
container_name: citizen_db
restart: always
env_file:
- ./citizenship.env
ports:
- "5432:5432"
volumes:
- ./db:/var/lib/postgresql/data/
citizen-backend:
build: './backend'
container_name: citizen_backend
working_dir: /app
env_file:
- ./citizenship.env
command: >
sh -c "python manage.py collectstatic --noinput
&& cp -Rf /app/static/* /static
&& python manage.py migrate
&& python manage.py init_admin
&& gunicorn -w 5 --bind 0.0.0.0:8000 cit.wsgi:application"
expose:
- "8000"
volumes:
- ./www/static/:/static
- ./backend/citizenrest:/app/
depends_on:
- citizen_db
citizen_frontend:
build: './frontend'
container_name: citizen_frontend
command: >
sh -c "npm run build
&& cp -Rf /app/build/* /www"
volumes:
- ./www:/www
depends_on:
- citizen-backend
nginx:
image: nginx:latest
container_name: citizen_nginx
ports:
- "80:80"
volumes:
- ./nginx:/etc/nginx
- ./www:/app
env_file:
- ./citizenship.env
depends_on:
- citizen_frontend
command: /bin/bash -c "envsubst '$$PRODUCTION_HOST' < /etc/nginx/conf.d/site.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"