forked from kema-dev/ft_transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
132 lines (126 loc) · 3.42 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
122
123
124
125
126
127
128
129
130
131
132
version: "3"
networks:
n_backend:
driver: bridge
name: n_backend
n_frontend:
driver: bridge
name: n_frontend
services:
s_postgresql:
build:
context: ./website/backend/postgresql/
image: "s_postgres"
networks:
- n_backend
restart: unless-stopped
environment:
- POSTGRES_DB=${POSTGRESQL_DATABASE}
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD}
- POSTGRES_USER=${POSTGRESQL_USERNAME}
healthcheck:
test: pg_isready -U ${POSTGRESQL_USERNAME}
interval: 10s
timeout: 5s
retries: 5
s_pgadmin:
build:
context: ./website/backend/pgadmin/
image: "s_pgadmin"
networks:
- n_backend
ports:
- "${PGADMIN_HOST_PORT}:${PGADMIN_PORT_HTTP}"
restart: unless-stopped
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD}
- GUNICORN_ACCESS_LOGFILE=${GUNICORN_ACCESS_LOGFILE}
- PGADMIN_CONFIG_UPGRADE_CHECK_ENABLED=${PGADMIN_CONFIG_UPGRADE_CHECK_ENABLED}
depends_on:
s_postgresql:
condition: service_healthy
s_nestjs:
build:
context: ./website/backend/nestjs/
image: "s_nestjs"
networks:
- n_backend
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
volumes:
- ./website/backend/nestjs/bind:/app
environment:
- POSTGRES_PORT=${POSTGRESQL_PORT}
- POSTGRES_USER=${POSTGRESQL_USERNAME}
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD}
- POSTGRES_DB=${POSTGRESQL_DATABASE}
- POSTGRES_HOST=s_postgresql
- FQDN=${FQDN}
- NEST_PHASE=${NEST_PHASE}
- JWT_SECRET=${JWT_SECRET}
- JWT_MAX_AGE=${JWT_MAX_AGE}
- API_42_UID=${API_42_UID}
- API_42_SECRET=${API_42_SECRET}
- API_42_REDIRECT_URI=${API_42_REDIRECT_URI}
restart: "no"
depends_on:
s_postgresql:
condition: service_healthy
healthcheck:
test: curl -kf https://localhost:3000/api/v1/auth/status || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 100s
s_vuejs:
build:
context: ./website/frontend/vuejs/
image: "s_vuejs"
networks:
- n_backend
- n_frontend
ports:
- "${FRONTEND_EXPOSED_HTTP}:${FRONTEND_PORT_HTTP}"
- "${FRONTEND_EXPOSED_HTTPS}:${FRONTEND_PORT_HTTPS}"
volumes:
- ./website/frontend/vuejs/bind:/app
restart: "no"
environment:
- API_42_UID=${API_42_UID}
- API_42_REDIRECT_URI=${API_42_REDIRECT_URI}
- FQDN=${FQDN}
- VUE_PHASE=${VUE_PHASE}
depends_on:
s_nestjs:
condition: service_started
healthcheck:
test: curl -kf https://localhost:443 || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 100s
s_nginx_frontend:
build:
context: ./website/frontend/nginx/
profiles:
- "prod"
image: "s_nginx"
networks:
- n_frontend
ports:
- "${FRONTEND_EXPOSED_HTTP}:${NGINX_PORT_HTTP}"
- "${FRONTEND_EXPOSED_HTTPS}:${NGINX_PORT_HTTPS}"
volumes:
- ./website/frontend/vuejs/bind/dist:/app
- ./website/frontend/nginx/my_server_block.conf:/opt/bitnami/nginx/conf/server_blocks/my_server_block.conf:ro
restart: unless-stopped
depends_on:
s_vuejs:
condition: service_completed_successfully
healthcheck:
test: curl -kf https://localhost:443 || exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 30s