Allowed more config flexibility

This commit is contained in:
WilliamMiceli
2018-07-08 19:02:46 -04:00
parent 816064506c
commit 5bd8a3ab90
2 changed files with 36 additions and 14 deletions

View File

@@ -5,14 +5,14 @@ services:
environment: environment:
APP_ENV: production APP_ENV: production
APP_DEBUG: false APP_DEBUG: false
APP_URL: http://localhost:${HTTP_PORT} APP_URL: ${URL}:${HOST_HTTP_PORT}
APP_CIPHER: AES-256-CBC APP_CIPHER: AES-256-CBC
APP_KEY: ${APP_KEY} APP_KEY: ${APP_KEY}
DB_STRICT: false DB_STRICT: false
DB_HOST: ninja-mysql DB_HOST: ninja-mysql
DB_DATABASE: ninja_db DB_DATABASE: ninja_db
DB_USERNAME: ninja DB_USERNAME: ninja
DB_PASSWORD: ninjaPass DB_PASSWORD: ${DB_USER_PASS}
{{- if (.Values.GMAPS_KEY)}} {{- if (.Values.GMAPS_KEY)}}
API_SECRET: ${MOBILE_APP_SECRET} API_SECRET: ${MOBILE_APP_SECRET}
{{- end}} {{- end}}
@@ -21,7 +21,7 @@ services:
{{- end}} {{- end}}
labels: labels:
{{- if (.Values.LABEL_KEY_VALUE)}} {{- if (.Values.LABEL_KEY_VALUE)}}
io.rancher.scheduler.affinity:host_label: ${LABEL_KEY_VALUE} io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}} {{- end}}
io.rancher.sidekicks: cron, web io.rancher.sidekicks: cron, web
links: links:
@@ -45,14 +45,14 @@ services:
environment: environment:
APP_ENV: production APP_ENV: production
APP_DEBUG: false APP_DEBUG: false
APP_URL: http://localhost:${HTTP_PORT} APP_URL: ${URL}:${HOST_HTTP_PORT}
APP_CIPHER: AES-256-CBC APP_CIPHER: AES-256-CBC
APP_KEY: ${APP_KEY} APP_KEY: ${APP_KEY}
DB_STRICT: false DB_STRICT: false
DB_HOST: ninja-mysql DB_HOST: ninja-mysql
DB_DATABASE: ninja_db DB_DATABASE: ninja_db
DB_USERNAME: ninja DB_USERNAME: ninja
DB_PASSWORD: ninjaPass DB_PASSWORD: ${DB_USER_PASS}
{{- if (.Values.GMAPS_KEY)}} {{- if (.Values.GMAPS_KEY)}}
API_SECRET: ${MOBILE_APP_SECRET} API_SECRET: ${MOBILE_APP_SECRET}
{{- end}} {{- end}}
@@ -61,7 +61,7 @@ services:
{{- end}} {{- end}}
labels: labels:
{{- if (.Values.LABEL_KEY_VALUE)}} {{- if (.Values.LABEL_KEY_VALUE)}}
io.rancher.scheduler.affinity:host_label: ${LABEL_KEY_VALUE} io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}} {{- end}}
links: links:
- db:ninja-mysql - db:ninja-mysql
@@ -72,12 +72,12 @@ services:
image: mysql:5 image: mysql:5
environment: environment:
MYSQL_DATABASE: ninja_db MYSQL_DATABASE: ninja_db
MYSQL_ROOT_PASSWORD: rootPass MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
MYSQL_USER: ninja MYSQL_USER: ninja
MYSQL_PASSWORD: ninjaPass MYSQL_PASSWORD: ${DB_USER_PASS}
labels: labels:
{{- if (.Values.LABEL_KEY_VALUE)}} {{- if (.Values.LABEL_KEY_VALUE)}}
io.rancher.scheduler.affinity:host_label: ${LABEL_KEY_VALUE} io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}} {{- end}}
restart: on-failure restart: on-failure
volumes: volumes:
@@ -86,12 +86,12 @@ services:
image: nginx image: nginx
labels: labels:
{{- if (.Values.LABEL_KEY_VALUE)}} {{- if (.Values.LABEL_KEY_VALUE)}}
io.rancher.scheduler.affinity:host_label: ${LABEL_KEY_VALUE} io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}} {{- end}}
links: links:
- app - app
ports: ports:
- "${HTTP_PORT}:80" - "${HOST_HTTP_PORT}:80"
restart: on-failure restart: on-failure
volumes: volumes:
- ${STORAGE_BASE_DIR}${CONFIG_DIR}/nginx.conf:/etc/nginx/nginx.conf:ro - ${STORAGE_BASE_DIR}${CONFIG_DIR}/nginx.conf:/etc/nginx/nginx.conf:ro

View File

@@ -8,7 +8,7 @@ catalog:
# upgrade_from: # upgrade_from:
questions: questions:
- variable: "LABEL_KEY_VALUE" - variable: "HOST_LABEL"
label: "Host Label Key/Value Pair" label: "Host Label Key/Value Pair"
description: | description: |
The Label Key/Value pair on the host which InvoiceNinja should be deployed The Label Key/Value pair on the host which InvoiceNinja should be deployed
@@ -16,8 +16,16 @@ catalog:
required: false required: false
type: string type: string
- variable: "HTTP_PORT" - variable: "URL"
label: "HTTP Port" label: "URL"
description: |
The domain or hostname the service can be accessed at.
default: "http://localhost"
required: true
type: string
- variable: "HOST_HTTP_PORT"
label: "Host HTTP Port"
description: | description: |
The HTTP port to access the web interface on. The HTTP port to access the web interface on.
default: "8000" default: "8000"
@@ -64,6 +72,20 @@ catalog:
required: true required: true
type: string type: string
- variable: "DB_ROOT_PASS"
label: "MySQL Root Password"
description: |
A secure password to be used by the "root" MySQL user.
required: true
type: password
- variable: "DB_USER_PASS"
label: "MySQL User Password"
description: |
A secure password to be used by the "ninja" MySQL user.
required: true
type: password
- variable: "APP_KEY" - variable: "APP_KEY"
label: "Encryption Key" label: "Encryption Key"
description: | description: |