-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
59 lines (59 loc) · 1.6 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
54
55
56
57
58
59
version: "3"
services:
frontend:
image: frontend
build:
context: frontend
dockerfile: Dockerfile
environment:
- PORT=8080
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`zalook.localhost`)"
- "traefik.http.routers.frontend.entrypoints=web"
ports:
- 8080
volumes:
- ./frontend/src:/app/src
- ./frontend/public:/app/public
backend:
image: backend
build:
context: backend
dockerfile: Dockerfile
environment:
# 👇 for remote DB connection
# - MONGODB_USERNAME=root
# - MONGODB_PASSWORD=xqv6yQrDMcASPbiw
# - MONGODB_DATABASE=nazneen
# 👇 for local DB connection
- MONGODB_CONNECTION_STRING=mongodb://mongo/zalook
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=(Host(`zalook.localhost`) && (PathPrefix(`/api`) || PathPrefix(`/socket`)))"
- "traefik.http.routers.backend.entrypoints=web"
ports:
- 3000
- 35729:35729
volumes:
- ./backend/src:/app/src
- ./backend/__tests__:/app/__tests__
mongo:
image: mongo
# 👇 to bind mongo to local port connection (to use Studio3T)
ports:
- 27017:27017
container_name: mongo
load-balancer:
image: traefik:v2.2
container_name: load-balancer
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"