-
Notifications
You must be signed in to change notification settings - Fork 2
/
.dc.stage.yml
73 lines (67 loc) · 1.62 KB
/
.dc.stage.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
version: '3.9'
services:
# ---- Public
nginx:
image: nginx:1.20-alpine
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
# nginx config
- ./nginx.stage.conf:/etc/nginx/conf.d/default.conf
# https certs
- ./env/staged-letsencrypt/:/etc/letsencrypt/
# served content
- srv_static:/srv/prod/static
- srv_frontend:/srv/prod/frontend
depends_on:
- django
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# --- Internal
django:
build:
context: ./webapp
dockerfile: Dockerfile.prod
command: "/bin/sh -c 'crond -f -d 6 & gunicorn webapp.wsgi:application --bind 0.0.0.0:8000'"
restart: unless-stopped
volumes:
- ./webapp:/srv/app
- srv_static:/srv/static
environment:
- DJANGO_STATIC_ROOT=/srv/static
env_file:
- ./env/stage.env
- ./env/civicrm.env
depends_on:
- postgres
postgres:
image: postgres:12.0-alpine
volumes:
- srv_db:/var/lib/postgresql/data/
restart: unless-stopped
env_file:
- ./env/stage.env
# --- Builders
vue:
build:
context: ./frontend
dockerfile: Dockerfile.prod
profiles: ["build"]
volumes:
- ./frontend/:/code/
- env_frontend:/code/node_modules/
- srv_frontend:/srv/frontend/
environment:
- VUE_OUTPUT_DIR=/srv/frontend/dist
- VUE_PUBLIC_PATH=/app/
env_file:
- ./env/stage.env
command: npm run build
volumes:
# Served volumes
srv_frontend:
srv_static:
srv_db:
# Environment(s)
env_frontend: