-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
137 lines (129 loc) · 4.42 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
version: "3.1"
services:
# mongodb
mobile-learning-mongo:
image: mongo
container_name: mobile-learning-mongo
environment:
- MONGO_INITDB=mobilelearning
volumes:
- ./mongo-data:/data/db
networks:
- proxy
restart: always
# mongo express
mobile-learning-mongoexpress:
image: mongo-express
container_name: mobile-learning-mongoexpress
environment:
- ME_CONFIG_MONGODB_URL=mongodb://mobile-learning-mongo:27017
- ME_CONFIG_MONGODB_SERVER=mobile-learning-mongo
- ME_CONFIG_MONGODB_PORT=27017
- ME_CONFIG_SITE_BASEURL=/mongo
- ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME}
- ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD}
labels:
- "traefik.enable=true"
- "traefik.http.routers.mongo-express.entrypoints=websecure"
- "traefik.http.routers.mongo-express.rule=Host(`${DOMAIN}`) && PathPrefix(`/mongo`)"
- "traefik.docker.network=proxy"
depends_on:
- mobile-learning-mongo
networks:
- proxy
restart: always
# java quarkus backend
mobile-learning-backend:
container_name: mobile-learning-backend
build:
context: ./backend
dockerfile: src/main/docker/Dockerfile.jvm
# dockerfile: Dockerfile
restart: always
# ports:
# - 8080:8080
depends_on:
- mobile-learning-mongo
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.entrypoints=websecure"
- "traefik.http.routers.backend.rule=Host(`${DOMAIN}`) && PathPrefix(`/api`)"
- "traefik.http.routers.backend.middlewares=api-stripprefix"
- "traefik.http.middlewares.api-stripprefix.stripprefix.prefixes=/api"
- "traefik.http.middlewares.api-stripprefix.stripprefix.forceSlash=false"
- "traefik.docker.network=proxy"
environment:
- QUARKUS_MONGODB_CONNECTION_STRING=mongodb://mobile-learning-mongo:27017
volumes:
- ./backend/src/main/resources/privateKey.pem:/deployments/privateKey.pem
- ./backend/src/main/resources/publicKey.pem:/deployments/publicKey.pem
- ./backend/src/main/resources/application.properties:/deployments/application.properties
networks:
- proxy
# flutter frontend
mobile-learning-frontend:
restart: always
container_name: mobile-learning-frontend
build:
context: ./frontend
dockerfile: Dockerfile
# ports:
# - "80:80"
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.entrypoints=websecure"
- "traefik.http.routers.frontend.rule=Host(`${DOMAIN}`)"
- "traefik.docker.network=proxy"
networks:
- proxy
# nextjs maintenance frontend (inputtool)
mobile-learning-inputtool:
restart: always
container_name: mobile-learning-inputtool
build:
context: ./inputtool
dockerfile: Dockerfile
labels:
- "traefik.enable=true"
- "traefik.http.routers.input.entrypoints=websecure"
- "traefik.http.routers.input.rule=Host(`${DOMAIN}`) && PathPrefix(`/input`)"
# - "traefik.http.routers.input.middlewares=input-stripprefix"
- "traefik.http.middlewares.input-stripprefix.stripprefix.prefixes=/input"
# - "traefik.http.middlewares.input-stripprefix.stripprefix.forceSlash=false"
- "traefik.docker.network=proxy"
networks:
- proxy
traefik-proxy:
container_name: traefik-proxy
image: traefik:v2.11
restart: always
command:
# - "--log.level=DEBUG"
# - "--api.insecure=true"
# - "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entryPoints.web.http.redirections.entrypoint.scheme=https
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.http.tls=true"
- "--entrypoints.websecure.http.tls.certresolver=prod"
- "--certificatesresolvers.prod.acme.tlschallenge=true"
- "--certificatesresolvers.prod.acme.email=fabian.klimpel@htwg-konstanz.de"
- "--certificatesresolvers.prod.acme.storage=/letsencrypt/acme.json"
ports:
# http ports
- "80:80"
- "443:443"
# web ui (enabled by --api.insecure=true)
# - "8080:8080"
volumes:
- "./letsencrypt:/letsencrypt"
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy
networks:
proxy:
name: proxy
driver: bridge