-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (41 loc) · 1.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
47 lines (41 loc) · 1.33 KB
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
version: "3.8"
### if you dont have a pre-built image, uncomment below to build from Dockerfile
# services:
# app:
# build: .
# container_name: node_app
# ports:
# - "3000:3000"
services:
app:
# image: web-app:latest # Use the pre-built image
image: web-app:2nd # Use the pre-built image
container_name: node_app
ports:
- "5000:5000"
environment:
- MONGODB_URI=mongodb://admin:admin123@mongo_db:27017/librarydb?authSource=admin
- SECRET=your_very_secret_key
depends_on:
- mongo
### If you want to use the official MongoDB image, uncomment below
# mongo:
# image: mongo:7.0
# container_name: mongo_db
# ports:
# - "27017:27017"
# environment:
# - MONGO_INITDB_ROOT_USERNAME=admin
# - MONGO_INITDB_ROOT_PASSWORD=admin123
# - MONGO_INITDB_DATABASE=librarydb
# volumes: # Uncomment to use initialization script if u have not used it in custom image
# - ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
mongo:
image: tapaskumarshety/mongo-server # Use your custom MongoDB image
container_name: mongo_db
ports:
- "27017:27017"
# environment:
# - MONGO_INITDB_ROOT_USERNAME=admin
# - MONGO_INITDB_ROOT_PASSWORD=admin123
# - MONGO_INITDB_DATABASE=librarydb