-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
53 lines (50 loc) · 1.11 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
version: "3.7"
services:
frontend_react:
container_name: frontend_react
image: node:14-alpine
working_dir: /app
volumes:
- ./frontend_react:/app
- /app/node_modules
ports:
- "8081:3000"
depends_on:
- rest_api
command: >
sh -c "npm install && npm start"
restart: always
env_file: .env
# Needed for compose
stdin_open: true
rest_api:
container_name: rest_api
image: golang:1.17
working_dir: /go/src/app
ports:
- "8080:8080"
expose:
- "8080"
depends_on:
- "mongo"
volumes:
- ./rest_golang:/go/src/app
command: go run main.go
restart: always
env_file: .env
mongo:
container_name: mongo
image: mongo:latest
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PWD}
MONGO_INITDB_DATABASE: ${MONGODB_DB_NAME}
ports:
- "27017:27017"
volumes:
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
- mongodb_data:/data/db
restart: always
volumes:
mongodb_data:
driver: local