-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yaml
51 lines (40 loc) · 963 Bytes
/
docker-compose.yaml
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
version: '3.9'
services:
jsonify:
build:
context: .
dockerfile: docker/Dockerfile
restart: always
# Expose ports [HOST:CONTAINER]
ports:
- "3000:3000"
# Service dependent on other containers to start.
depends_on:
- mongodb
- redis
volumes:
# Mounts the project directory on the host to /app inside the container,
# allowing you to modify the code without having to rebuild the image.
# node_modules from this new volume will be used and not from your local dev env.
- ./:/usr/src/app
- /usr/src/app/node_modules
# Set environment variables from this file
env_file:
- ./.env
mongodb:
image: mongo:7.0
container_name: mongodb
volumes:
- data:/data/db
ports:
- "27017:27017"
redis:
image: redis:7.2
container_name: cache
ports:
- "6379:6379"
volumes:
- cache:/data
volumes:
data:
cache: