-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
92 lines (88 loc) · 2.14 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
version: "3"
services:
backend:
container_name: backend
restart: always
build:
context: ./backend
dockerfile: Dockerfile
target: production
args:
- NODE_ENV=production
environment:
- NODE_ENV=production
- SOCKET_PORT=3000
- PORT=80
- DB_PORT=5432
- DB_HOST=postgres
- DB_USER=${DB_USER:?err}
- DB_PASSWORD=${DB_PASSWORD:?err}
- DB_NAME=${DB_NAME:?err}
- DB_PATH=data/
- FRONTEND_URL=${FRONT_URL:?err}
- COOKIE_SESSION_KEY=${COOKIE_SESSION_KEY:?err}
- UPLOAD_DIR=uploads/
- APP_URL=${BACK_URL:?err}
- FORTYTWO_APP_ID=${FORTYTWO_APP_ID:?err}
- FORTYTWO_APP_SECRET=${FORTYTWO_APP_SECRET:?err}
- FORTYTWO_APP_REDIRECT_URI=${FORTYTWO_APP_REDIRECT_URI:?err}
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:80/api/heartbeat || exit 1"
]
interval: 5s
timeout: 5s
retries: 20
ports:
- 80
- 3000
depends_on:
postgres:
condition: service_healthy
volumes:
- ./data/uploads:/uploads
networks:
- transcendence
frontend:
container_name: frontend
restart: always
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_APP_BASE_URL=${BACK_URL:?err}
- VITE_API_URL=${BACK_URL:?err}/api
- VITE_SOCKET_URL=${BACK_URL:?err}
- VITE_APP_URL=${FRONT_URL:?err}
depends_on:
backend:
condition: service_healthy
ports:
- ${EXTERNAL_PORT:?err}:80
volumes:
- ./data/uploads:/usr/share/nginx/html/uploads
networks:
- transcendence
postgres:
container_name: postgres
image: postgres:alpine
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 20
environment:
POSTGRES_USER: ${DB_USER:?err}
POSTGRES_PASSWORD: ${DB_PASSWORD:?err}
POSTGRES_DB: ${DB_NAME:?err}
ports:
- 5432
volumes:
- ./data/db:/var/lib/postgresql/data
networks:
- transcendence
networks:
transcendence: