Added Traefik integration

This commit is contained in:
WilliamMiceli
2018-11-17 18:51:02 -05:00
parent f54e0a2bd7
commit 84ffae0ff1
2 changed files with 27 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ services:
environment:
APP_ENV: production
APP_DEBUG: false
APP_URL: ${URL}:${WEB_PORT}
APP_URL: ${TRAEFIK_HOST}:${WEB_PORT}
APP_KEY: ${APP_KEY}
MYSQL_HOST: mysql
MYSQL_DATABASE: snipeit
@@ -22,8 +22,22 @@ services:
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
{{- if .Values.TRAEFIK_HOST}}
traefik.enable: true
traefik.frontend.rule: Host:${TRAEFIK_HOST}
traefik.frontend.entryPoints: http,https
traefik.frontend.headers.forceSTSHeader: true
traefik.frontend.headers.SSLRedirect: true
traefik.frontend.headers.STSPreload: true
traefik.frontend.headers.STSSeconds: 15552000
traefik.port: "80"
{{- else}}
traefik.enable: false
{{- end}}
links:
- mysql
networks:
- public-proxy
ports:
- "${WEB_PORT}:80"
restart: on-failure
@@ -46,4 +60,8 @@ services:
{{- end}}
restart: on-failure
volumes:
- /RancherCattleData/${DATA_DIR}/Database:/var/lib/mysql
- /RancherCattleData/${DATA_DIR}/Database:/var/lib/mysql
networks:
public-proxy:
external: true