Skip to content

Commit 9fc9bec

Browse files
committed
Upgrade script to use with traefik
1 parent 6fab0ee commit 9fc9bec

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

.env.dist

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ MAILER_TRANSPORT=smtp
2828
MAILER_USER=username
2929
MAILER_PASSWORD=password
3030

31-
# Api-specifiv stuff
31+
# Host specific stuff
32+
HOST_URL=dev.inowas.hydro.tu-dresden.de
33+
TRAEFIK_NETWORK_NAME=traefik_web
34+
35+
# API specific stuff
3236
API_SECRET=7bdbeb4493b2796ff94252f0736b18de433f8a67
3337
API_BASE_URL=
3438
API_HOST_URL=api.dev.inowas.hydro.tu-dresden.de

app.yml

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
version: "2.1"
22

33
services:
4-
app:
5-
build: ${APP_PATH}
6-
restart: always
7-
ports:
8-
- ${APP_HTTP_PORT}:5000
4+
app:
5+
build: ${APP_PATH}
6+
restart: always
7+
expose:
8+
- 5000
9+
labels:
10+
- "traefik.docker.network=${TRAEFIK_NETWORK_NAME}"
11+
- "traefik.enable=true"
12+
- "traefik.wiki.frontend.rule=${HOST_URL}"
13+
- "traefik.wiki.port=5000"
14+
- "traefik.wiki.protocol=http"
15+
networks:
16+
- web
17+
- default
18+
19+
networks:
20+
web:
21+
external:
22+
name: ${TRAEFIK_NETWORK_NAME}

docker-compose.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ services:
2222
POSTGRES_USER: ${DATABASE_USER}
2323
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
2424
POSTGRES_DB: ${DATABASE_NAME}
25-
ports:
26-
- "5432:5432"
2725

2826
php:
2927
image: inowas/docker-php7-fpm-with-geos
@@ -208,10 +206,19 @@ services:
208206
nginx:
209207
image: inowas/docker-nginx
210208
restart: always
211-
ports:
212-
- ${API_HTTP_PORT}:80
209+
expose:
210+
- 80
213211
volumes_from:
214212
- php
213+
networks:
214+
- web
215+
- default
216+
labels:
217+
- "traefik.docker.network=${TRAEFIK_NETWORK_NAME}"
218+
- "traefik.enable=true"
219+
- "traefik.frontend.rule=Host: api.${HOST_URL}"
220+
- "traefik.port=80"
221+
- "traefik.protocol=http"
215222

216223
modflow-calculation:
217224
image: inowas/pymodelling:latest
@@ -284,6 +291,11 @@ services:
284291
links:
285292
- rabbitmq
286293

294+
networks:
295+
web:
296+
external:
297+
name: ${TRAEFIK_NETWORK_NAME}
298+
287299
volumes:
288300
api-data:
289301
driver: local

0 commit comments

Comments
 (0)