-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
102 lines (97 loc) · 2.49 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
name: infra-langate
services:
backend:
build: ./backend
image: langate/backend
environment:
WEBSITE_HOST: ${WEBSITE_HOST}
HTTP_PROTOCOL: ${PROTOCOL}
DB_HOST: db
DB_PORT: 5432
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
NGINX_PORT: ${EXTERNAL_NGINX_PORT}
STATIC_ROOT: ${BACKEND_STATIC_ROOT}
MEDIA_ROOT: ${BACKEND_MEDIA_ROOT}
SUPERUSER_USER: ${SUPERUSER_USER}
SUPERUSER_PASS: ${SUPERUSER_PASS}
DJANGO_SECRET: ${BACKEND_DJANGO_SECRET}
SESSION_COOKIE_AGE: ${SESSION_COOKIE_AGE}
DEV: 0
volumes:
- ./volumes/prod/backend:/app/v1
- ./backend:/app
expose:
- 8000
networks:
- backend
links:
- db
depends_on:
db:
condition: service_healthy
db:
image: postgres
environment:
POSTGRES_USER: ${DB_SUPERUSER}
POSTGRES_PASSWORD: ${DB_SUPERPASS}
LANGATE_USERNAME: ${DB_USER}
LANGATE_PASSWORD: ${DB_PASS}
LANGATE_DATABASE: ${DB_NAME}
TZ: Europe/Paris
PGTZ: Europe/Paris
volumes:
- ./init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
- ./volumes/prod/postgres/data:/var/lib/postgresql/data
expose:
- 5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 1s
timeout: 5s
retries: 10
networks:
- backend
frontend:
build: ./frontend
image: langate/frontend
environment:
- VITE_API_URL=${PROTOCOL}://api.${WEBSITE_HOST}
- NODE_ENV=${FRONTEND_NODE_ENV}
- VITE_WEBSITE_HOST=${WEBSITE_HOST}
- VITE_SESSION_COOKIE_AGE=${SESSION_COOKIE_AGE}
volumes:
- ./volumes/prod/frontend:/src/dist
networks:
- backend
nginx:
image: nginx
environment:
- NGINX_HOST=${WEBSITE_HOST}
- NGINX_PORT=80
- STATIC_ROOT=${BACKEND_STATIC_ROOT}
- MEDIA_ROOT=${BACKEND_MEDIA_ROOT}
ports:
- "${PROD_NGINX_PORT}:80"
volumes:
- ./volumes/prod/backend:/usr/share/nginx/html
- ./volumes/prod/frontend:/usr/share/nginx/html/frontend
- ./nginx/templates/prod:/etc/nginx/templates:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./volumes/prod/nginx/logs:/var/log/nginx
networks:
- backend
depends_on:
- backend
- frontend
netcontrol:
build: ./netcontrol
restart: unless-stopped
cap_add:
- NET_ADMIN
volumes:
- ${VARIABLES_PATH}:/variables.json
network_mode: "host"
networks:
backend: