Skip to content

Commit 7c88913

Browse files
committed
add docker compose and mongodb:wq
1 parent b9186ad commit 7c88913

5 files changed

Lines changed: 630 additions & 238 deletions

File tree

server/docker-compose.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
services:
2+
server:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
container_name: server
7+
hostname: server
8+
env_file:
9+
- .env
10+
environment:
11+
PORT: ${PORT}
12+
MONGO_URI: ${MONGO_URI}
13+
ports:
14+
- "${PORT}:${PORT}"
15+
depends_on:
16+
- mongodb
17+
networks:
18+
- mongodb_network
19+
mongodb:
20+
image: mongo:latest
21+
container_name: mongodb
22+
hostname: mongodb
23+
volumes:
24+
- mongodb-data:/data/db/
25+
- mongodb-log:/var/log/mongodb/
26+
env_file:
27+
- .env
28+
environment:
29+
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
30+
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
31+
ports:
32+
- "27017:27017"
33+
networks:
34+
- mongodb_network
35+
36+
volumes:
37+
mongodb-data:
38+
driver: local
39+
name: mongo-data
40+
mongodb-log:
41+
driver: local
42+
name: mongo-log
43+
44+
networks:
45+
mongodb_network:
46+
driver: bridge
47+
name: mongo-network

0 commit comments

Comments
 (0)