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
@@ -47,3 +61,7 @@ services:
restart: on-failure
volumes:
- /RancherCattleData/${DATA_DIR}/Database:/var/lib/mysql
networks:
public-proxy:
external: true

View File

@@ -1,6 +1,6 @@
version: '2'
catalog:
name: SnipeIT
name: Snipe-IT
version: latest
# description:
# minimum_rancher_version:
@@ -16,12 +16,13 @@ catalog:
required: false
type: string
- variable: "URL"
label: "URL"
- variable: "TRAEFIK_HOST"
label: "Public Host Domain"
description: |
The domain or hostname the service can be accessed at.
default: "http://localhost"
required: true
The host that Traefik will use to provide public access.
Leaving this empty will disable Traefik on this stack.
default: "subdomain.domain.tld"
required: false
type: string
- variable: "WEB_PORT"