-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
102 lines (100 loc) · 3.19 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# #HOST_PORT:DOCKER_PORT
version: "2.4"
services:
#############################################################################
frontend:
container_name: "MONO_FRONTEND"
tty: true
build:
context: .
dockerfile: ./frontend/Dockerfile
target: dev
environment:
- HOST_BACKEND=backend
- NODE_ENV=development
volumes:
- ./package.json:/app/package.json
- ./babel.config.js:/app/babel.config.js
- ./.eslintrc.js:/app/.eslintrc.js
- ./tsconfig.json:/app/tsconfig.json
- ./frontend:/app/frontend:rw
- frontend-deps:/app/node_modules
- frontend-nested-deps:/app/frontend/node_modules
# labels:
# # Route config
# - "traefik.http.routers.fe-router.rule=Host(`ruman.fi`,`ruman.com`)"
# # https setting, with certificate
# # - "traefik.http.routers.fe-router.tls.certresolver=fe-cert"
# # - "traefik.http.routers.fe-router.entrypoints=websecure"
# # - "traefik.http.services.fe-service.loadbalancer.server.port=8090"
# - "traefik.enable=true"
ports:
- 1111:1111
#############################################################################
backend:
tty: true
container_name: "MONO_BACKEND"
build:
context: .
dockerfile: ./backend/Dockerfile
target: dev
environment:
- HOST_DB=database
- NODE_ENV=development
- PORT=3000
env_file:
- SECRETS/dev.env
volumes:
- ./package.json:/app/package.json
- ./babel.config.js:/app/babel.config.js
- ./.eslintrc.js:/app/.eslintrc.js
- ./tsconfig.json:/app/tsconfig.json
- ./backend:/app/backend:rw
- backend-deps:/app/node_modules
- backend-nested-deps:/app/backend/node_modules
depends_on:
database:
condition: service_healthy
redis:
condition: service_healthy
ports:
- 3000:3000 # Sometimes only backend is needed. e.g. mobile app
############################################################################
database:
container_name: "MONO_DATABASE"
image: mongo:4
restart: always
# environment:
# MONGO_INITDB_ROOT_USERNAME: prisma
# MONGO_INITDB_ROOT_PASSWORD: prisma
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
volumes:
- ~/mono/data/db:/data/db
ports:
- "27010:27017"
redis:
container_name: "MONO_REDIS"
image: redis:5.0.6-alpine
healthcheck:
test: redis-cli ping
# #############################################################################
# - "traefik.http.routers.fe-router.middlewares=fe-auth"
# - "traefik.http.middlewares.fe-auth.basicauth.users=test:"
reverse-proxy:
container_name: "MONO_TRAEFIK"
image: "traefik:v2.0.2"
volumes:
# - "./acme.json:/acme.json"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik/traefik.toml:/etc/traefik/traefik.toml"
ports:
- "80:8090" # PROXY ENTRYPOINT
- "443:443" # PROXY ENTRYPOINT
- "8080:8080" # TRAEFIK DASHBOARD
# #############################################################################
volumes:
frontend-deps:
frontend-nested-deps:
backend-deps:
backend-nested-deps: