-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
59 lines (51 loc) · 1.2 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
# Services
services:
# Server service
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: backend
ports:
- "3001:3001"
env_file: ./.env
environment:
- DB_HOST=mongodb_server
- DB_USER=$MONGODB_USER
- DB_PASSWORD=$MONGODB_PASSWORD
- DB_NAME=$MONGODB_DATABASE
- DB_PORT=27017
- MONGODB_URI=$MONGODB_URI
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
depends_on:
- mongodb
# Client service
client:
build:
context: ./client
dockerfile: Dockerfile
container_name: frontend
ports:
- "5173:80"
depends_on:
- server
# Database service
mongodb:
image: mongo:latest
container_name: mongodb_server
env_file: ./.env
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGODB_USER
- MONGO_INITDB_ROOT_PASSWORD=$MONGODB_PASSWORD
- MONGO_INITDB_DATABASE=$MONGODB_DATABASE
ports:
- "27017:27017"
volumes:
- ./server/models/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
# Volumes
volumes:
mongodata: