forked from ErwanLP/formationNode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
48 lines (40 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
version: '3'
services:
reverse-proxy:
image: traefik:v2.0
command: --api.insecure=true --providers.docker
ports:
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
mongodb:
image: mongo:latest
ports:
- 27017:27017
volumes:
- mongodb_data_container:/data/db
mongodbclient:
image: mongoclient/mongoclient:latest
environment:
MONGOCLIENT_DEFAULT_CONNECTION_URL: "mongodb://mongodb:27017/formation-node"
labels:
- "traefik.http.routers.mongodbclient.rule=Host(`mongo.localhost`)"
- "traefik.http.services.mongodbclient.loadbalancer.server.port=3000"
node:
image: thecodingmachine/nodejs:16
volumes:
- ./:/usr/src/app
environment:
STARTUP_COMMAND_1: npm install
STARTUP_COMMAND_2: nodemon ./bin/www
depends_on:
- mongodb
links:
- mongodb
labels:
- "traefik.http.routers.api.rule=Host(`node.localhost`)"
- "traefik.http.services.api.loadbalancer.server.port=3001"
volumes:
mongodb_data_container: