-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
37 lines (34 loc) · 1.3 KB
/
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
services:
# container named coin-converter-app
app:
container_name: crypto-converter-app
# restart: unless-stopped
build:
context: .
dockerfile: Dockerfile
environment:
- PORT=${PORT:-3000}
# Comment the code below if you are using atlas or another service
- MONGODB_USERNAME=${MONGODB_USERNAME:-root}
- MONGODB_PASSWORD=${MONGODB_PASSWORD:-root}
- MONGODB_HOST=db
- MONGODB_PORT=27017
- MONGODB_DATABASE=${MONGODB_DATABASE:-crypto}
# Uncomment the code below if you are using atlas or another service
# - MONGODB_URI=${MONGODB_URI}
ports:
- 3000:${PORT:-3000}
depends_on:
- db
# Comment the code below if you are using atlas or another service
db:
container_name: crypto-converter-db
restart: unless-stopped
image: mongo:6.0.15-rc0-jammy
volumes:
- ./data/db:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME:-root}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD:-root}
MONGO_INITDB_DATABASE: ${MONGODB_DATABASE:-crypto}