-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
121 lines (115 loc) · 3.16 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
name: infra-insalanfr
services:
backend:
build: ./backend
image: insalan/backend
restart: unless-stopped
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}
MONGODB_USER: ${MONGODB_USER}
MONGODB_PASS: ${MONGODB_PASS}
NGINX_PORT: ${EXTERNAL_NGINX_PORT}
MAIL_AUTH: ${MAIL_AUTH}
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}
HELLOASSO_HOSTNAME: ${HELLOASSO_HOSTNAME}
HELLOASSO_ORGANIZATION_SLUG: ${HELLOASSO_ORG_SLUG}
HELLOASSO_CLIENT_ID: ${HELLOASSO_CLIENT_ID}
HELLOASSO_CLIENT_SECRET: ${HELLOASSO_CLIENT_SECRET}
HELLOASSO_BACK_URL: ${HELLOASSO_BACK_URL}
HELLOASSO_RETURN_URL: ${HELLOASSO_RETURN_URL}
HELLOASSO_ERROR_URL: ${HELLOASSO_ERROR_URL}
RIOT_API_KEY: ${RIOT_API_KEY}
DEV: 0
volumes:
- ./volumes/prod/backend:/app/v1
expose:
- 8000
networks:
- backend
links:
- db
depends_on:
db:
condition: service_healthy
db:
image: postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_SUPERUSER}
POSTGRES_PASSWORD: ${DB_SUPERPASS}
INSALAN_USERNAME: ${DB_USER}
INSALAN_PASSWORD: ${DB_PASS}
INSALAN_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
mongo-db:
image: mongo
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_SUPERUSER}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASS}
expose:
- 5433
networks:
- backend
command:
- '--logpath'
- '/dev/null'
frontend:
build: ./frontend
image: insalan/frontend
environment:
- VITE_API_URL=${PROTOCOL}://api.${WEBSITE_HOST}/v${API_VERSION}
- NODE_ENV=${FRONTEND_NODE_ENV}
- VITE_WEBSITE_HOST=${WEBSITE_HOST}
- VITE_SESSION_COOKIE_AGE=${SESSION_COOKIE_AGE}
volumes:
- ./volumes/prod/frontend:/dist
networks:
- backend
nginx:
image: nginx
restart: unless-stopped
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
networks:
backend: