-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
66 lines (66 loc) · 1.86 KB
/
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
version: "3.9"
services:
web:
build: web
ports:
- "${NGINX_PORT}:80"
depends_on:
- frontend
- backend
volumes:
- avatar-images:/var/www/avatar
frontend:
build: frontend
command: npm run dev
environment:
PORT: ${FRONTEND_PORT}
API_URL: http://backend:${BACKEND_PORT}/api
NEXT_PUBLIC_API_URL: ${PUBLIC_API_URL}
NEXT_PUBLIC_WEB_URL: ${PUBLIC_WEB_URL}
JWT_PUBLIC_KEY: ${JWT_PUBLIC_KEY}
JWT_SECRET: ${FRONTEND_JWT_SECRET}
OAUTH_42_CLIENT_ID: ${OAUTH_42_CLIENT_ID}
depends_on:
backend:
condition: service_healthy
db:
condition: service_healthy
backend:
build: backend
command: sh -c "yarn start:dev"
environment:
PORT: ${BACKEND_PORT}
JWT_PUBLIC_KEY: ${JWT_PUBLIC_KEY}
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
TWO_FACTOR_AUTHENTICATION_APP_NAME: ${TWO_FACTOR_AUTHENTICATION_APP_NAME}
OAUTH_42_CLIENT_ID: ${OAUTH_42_CLIENT_ID}
OAUTH_42_CLIENT_SECRET: ${OAUTH_42_CLIENT_SECRET}
NEST_PUBLIC_API_URL: ${PUBLIC_API_URL}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_PORT}/api"]
interval: 5s
timeout: 5s
retries: 10
depends_on:
db:
condition: service_healthy
volumes:
- avatar-images:/app/public/avatar
db:
image: postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
healthcheck:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER}"]
interval: 5s
timeout: 5s
retries: 10
volumes:
avatar-images: