Added Traefik integration
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user