forked from CAMAP-APP/camap-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
104 lines (96 loc) · 3.73 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
103
104
version: "2"
services:
reverse-proxy:
# The official v3 Traefik docker image
image: traefik:beaufort
# Enables the web UI and tells Traefik to listen to docker
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.nest.adress=:3010"
ports:
- "80:80"
- "443:443"
- "3010:3010"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/traefik.yml
- ./traefik/config:/etc/traefik/config
- ./logs:/var/log/traefik
- ./ssl:/etc/traefik/config/ssl
labels:
# CROS error
- "traefik.http.middlewares.serviceheaders.headers.accesscontrolalloworiginlist=https://camap.localdomain,https://api.camap.localdomain"
- "traefik.http.middlewares.serviceheaders.headers.accesscontrolallowmethods=PUT,GET,POST,HEAD,PATCH,DELETE,OPTION"
- "traefik.http.middlewares.serviceheaders.headers.accesscontrolallowcredentials=true"
- "traefik.http.middlewares.serviceheaders.headers.accesscontrolallowheaders=x-cavea-url,authorization,x-requested-with,accept-api-version,content-type,cookie"
- "traefik.http.middlewares.serviceheaders.headers.accesscontrolmaxage=100"
- "traefik.http.middlewares.serviceheaders.headers.addvaryheader=true"
- "traefik.http.routers.service.middlewares=serviceheaders"
loc-mysql:
build:
context: .
dockerfile: mysql.Dockerfile
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=db-camap
- MYSQL_USER=docker
- MYSQL_PASSWORD=docker
container_name: loc-mysql
expose:
- 3306
volumes:
- database:/var/lib/mysql
# if you want easily get dumps from container
# - ./mysql/dumps/:/root/dumps
labels:
- "traefik.enable=false"
nest-loc-camap:
depends_on:
- loc-mysql
container_name: nest-loc-camap
build:
context: .
dockerfile: camap-ts.Dockerfile
env_file: camap-ts/.env
expose:
- 3010
- 6007
working_dir: /srv/packages/api-core
command: npm run start:prod # start:dev for dev env (cf docker-compose.dev.yml)
labels:
- "traefik.http.routers.nest-loc-camap.rule=Host(`api.camap.localdomain`)"
- "traefik.http.services.nest-loc-camap.loadbalancer.server.port=3010"
- "traefik.http.routers.nest-loc-camap.entrypoints=websecure"
- "traefik.http.routers.nest-loc-camap.tls=true"
- "traefik.http.routers.nest-loc-camap.middlewares=serviceheaders"
#- "traefik.http.routers.nest-loc-camap.tls.certresolver=le"
#- "traefik.http.routers.nest-loc-camap.tls.domains[0].main=localdomain"
#- "traefik.http.routers.nest-loc-camap.tls.domains[0].sans=*.localdomain"
neko-loc-camap:
build:
context: .
dockerfile: camap-hx.Dockerfile
container_name: neko-loc-camap
expose:
- 80
depends_on:
- loc-mysql
- nest-loc-camap
labels:
- "traefik.http.routers.neko-loc-camap.rule=Host(`camap.localdomain`)"
- "traefik.http.services.neko-loc-camap.loadbalancer.server.port=80"
- "traefik.http.routers.neko-loc-camap.entrypoints=websecure"
- "traefik.http.routers.neko-loc-camap.tls=true"
- "traefik.http.routers.neko-loc-camap.middlewares=serviceheaders"
#- "traefik.http.routers.neko-loc-camap.tls.certresolver=le"
#- "traefik.http.routers.neko-loc-camap.tls.domains[0].main=localdomain"
#- "traefik.http.routers.neko-loc-camap.tls.domains[0].sans=*.localdomain"
volumes:
database: