From bd783274970f6cebbefd688af27ea7fe37d432e5 Mon Sep 17 00:00:00 2001 From: WilliamMiceli <9000802+WilliamMiceli@users.noreply.github.com> Date: Wed, 11 Jul 2018 03:03:45 -0400 Subject: [PATCH] Majority setup --- templates/SnipeIT/0/docker-compose.yml | 56 ++++++++++++++++++ templates/SnipeIT/0/rancher-compose.yml | 79 ++++++++++++++++++++++++- 2 files changed, 134 insertions(+), 1 deletion(-) diff --git a/templates/SnipeIT/0/docker-compose.yml b/templates/SnipeIT/0/docker-compose.yml index e69de29..4bd96f9 100644 --- a/templates/SnipeIT/0/docker-compose.yml +++ b/templates/SnipeIT/0/docker-compose.yml @@ -0,0 +1,56 @@ +version: '2' +services: + + snipe: + image: snipe/snipe-it:latest + depends_on: + - mysql + dns: + - 1.1.1.1 + - 1.0.0.1 + environment: + APP_ENV: production + APP_DEBUG: false + APP_URL: ${URL}:${HOST_HTTP_PORT} + APP_KEY: ${APP_KEY} + MYSQL_HOST: mysql + MYSQL_DATABASE: snipeit + MYSQL_USER: snipe_user + MYSQL_PASSWORD: ${DB_USER_PASS} + APP_ENV: + labels: +{{- if (.Values.HOST_LABEL)}} + io.rancher.scheduler.affinity:host_label: ${HOST_LABEL} +{{- end}} + networks: + - snipe-net + ports: + - "${HOST_HTTP_PORT}:80" + - "${HOST_HTTPS_PORT}:443" + restart: on-failure + volumes: + - ${STORAGE_BASE_DIR}${APP_DIR}:/var/lib/snipeit + + mysql: + image: mysql:5 + dns: + - 1.1.1.1 + - 1.0.0.1 + environment: + MYSQL_DATABASE: snipeit + MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS} + MYSQL_USER: snipe_user + MYSQL_PASSWORD: ${DB_USER_PASS} + labels: +{{- if (.Values.HOST_LABEL)}} + io.rancher.scheduler.affinity:host_label: ${HOST_LABEL} +{{- end}} + networks: + - snipe-net + restart: on-failure + volumes: + - ${STORAGE_BASE_DIR}${DB_DIR}:/var/lib/mysql + +networks: + snipe-net: + driver: bridge \ No newline at end of file diff --git a/templates/SnipeIT/0/rancher-compose.yml b/templates/SnipeIT/0/rancher-compose.yml index 9e2e78b..9ce80f3 100644 --- a/templates/SnipeIT/0/rancher-compose.yml +++ b/templates/SnipeIT/0/rancher-compose.yml @@ -6,4 +6,81 @@ catalog: # minimum_rancher_version: # maximum_rancher_version: # upgrade_from: - questions: \ No newline at end of file + questions: + + - variable: "HOST_LABEL" + label: "Host Label Key/Value Pair" + description: | + The Label Key/Value pair on the host which InvoiceNinja should be deployed + default: "host.id=0000" + required: false + type: string + + - variable: "URL" + 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: | + The HTTP port to access the web interface on. + default: "6000" + required: true + type: string + + - variable: "HOST_HTTPS_PORT" + label: "Host HTTPS Port" + description: | + The HTTPS port to access the web interface on. + default: "6500" + required: true + type: string + + - variable: "STORAGE_BASE_DIR" + label: "Base Storage Directory" + description: | + The base path of where persistent storage should be kept at. + default: "/RancherStorage/InvoiceNinja" + required: true + type: string + + - variable: "APP_DIR" + label: "Application Directory" + description: | + The folder for persistent application files. + default: "/Application" + required: true + type: string + + - variable: "DB_DIR" + label: "Database Directory" + description: | + The folder for persistent database files. + default: "/Database" + required: true + 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 "snipe_user" MySQL user. + required: true + type: password + + - variable: "APP_KEY" + label: "Encryption Key" + description: | + A random 32-Character string which will be used for encryption. + required: true + type: password \ No newline at end of file