-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
71 lines (65 loc) · 1.87 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
version: "3.8"
services:
web:
container_name: web
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/certs:/etc/nginx/certs # certificats
- ./nginx/entrypoint.sh:/docker-entrypoint.d/startup.sh # startup script select dev or prod conf
- ./nginx/dev.conf:/dev.conf # dev conf
- ./nginx/prod.conf:/prod.conf # prod conf
- frontend-prod-data:/usr/share/nginx/html # vite build prod
- uploads:/usr/share/nginx/html/uploads # uploads
depends_on:
- backend
networks:
- frontend-network
environment:
- BUILD_TYPE=${BUILD_TYPE:-dev} # Default to dev if BUILD_TYPE is not set
frontend:
container_name: frontend
build: ./transcendance-frontend/
volumes:
- ./transcendance-frontend/src:/app/src # need to be open for dev, but not necessary in production
- ./transcendance-frontend/public:/app/public # need to be open for dev, but not necessary in production
- frontend-prod-data:/app/dist
- uploads:/app/dist/uploads
networks:
- frontend-network
env_file: .env
backend:
container_name: backend
build: ./transcendance-backend/
volumes:
- ./transcendance-backend/src:/app/src # need to be open for dev, but not necessary in production
- ./transcendance-backend/prisma:/app/prisma # need to be open for dev, but not necessary in production
- uploads:/app/uploads
networks:
- frontend-network
- backend-network
depends_on:
- db
env_file: .env
db:
container_name: db
image: postgres:latest
env_file: .env
volumes:
- db:/var/lib/postgresql/data
networks:
- backend-network
networks:
frontend-network:
driver: bridge
backend-network:
driver: bridge
volumes:
db:
driver: local
frontend-prod-data:
driver: local
uploads:
driver: local