diff --git a/templates/drupal/1/docker-compose.yml b/templates/drupal/1/docker-compose.yml deleted file mode 100644 index f65bf88..0000000 --- a/templates/drupal/1/docker-compose.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: '2' - -services: - - drupal: - image: drupal:8.2-apache - labels: - io.rancher.sidekicks: postgres,drupal-datavolume - io.rancher.container.pull_image: always - ports: - - ${public_port}:80 - links: - - postgres:postgres - volumes_from: - - drupal-datavolume - restart: always - - postgres: - labels: - io.rancher.sidekicks: drupal-datavolume - io.rancher.container.pull_image: always - image: postgres:9.6 - environment: - POSTGRES_USER: ${DB_USER} - POSTGRES_PASSWORD: ${DB_PASS} - POSTGRES_DB: ${DB_NAME} - volumes_from: - - drupal-datavolume - restart: always - - drupal-datavolume: - image: "busybox" - volumes: - - /var/www/drupal - - /var/lib/postgresql - labels: - io.rancher.container.start_once: true - entrypoint: ["/bin/true"] diff --git a/templates/drupal/1/docker-compose.yml.tpl b/templates/drupal/1/docker-compose.yml.tpl new file mode 100644 index 0000000..39657db --- /dev/null +++ b/templates/drupal/1/docker-compose.yml.tpl @@ -0,0 +1,59 @@ +version: '2' +services: + drupal: + image: drupal:8.3.5-apache + labels: + io.rancher.container.hostname_override: container_name + links: + - db:db + volumes: + - drupal-modules:/var/www/html/modules + - drupal-profiles:/var/www/html/profiles + - drupal-themes:/var/www/html/themes + - drupal-sites:/var/www/html/sites + restart: always + + drupal-lb: + image: rancher/lb-service-haproxy:v0.6.4 + ports: + - ${PUBLIC_PORT}:${PUBLIC_PORT} + + db: + labels: + io.rancher.container.hostname_override: container_name + {{- if eq .Values.DB_TYPE "postgres"}} + image: postgres:9.6.3-alpine + environment: + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASS} + POSTGRES_DB: ${DB_NAME} + {{- end}} + {{- if eq .Values.DB_TYPE "mysql"}} + image: mysql:5.7.18 + environment: + MYSQL_DATABASE: ${DB_NAME} + MYSQL_ROOT_PASSWORD: ${DB_PASS} + MYSQL_USER: ${DB_USER} + MYSQL_PASSWORD: ${DB_PASS} + {{- end}} + volumes: + {{- if eq .Values.DB_TYPE "postgres"}} + - db-data:/var/lib/postgresql + {{- end}} + {{- if eq .Values.DB_TYPE "mysql"}} + - db-data:/var/lib/mysql + {{- end}} + restart: always + +volumes: + drupal-modules: + driver: local + drupal-profiles: + driver: local + drupal-themes: + driver: local + drupal-sites: + driver: local + db-data: + driver: local + diff --git a/templates/drupal/1/rancher-compose.yml b/templates/drupal/1/rancher-compose.yml index de7e83e..8fb6f3e 100644 --- a/templates/drupal/1/rancher-compose.yml +++ b/templates/drupal/1/rancher-compose.yml @@ -1,17 +1,28 @@ -.catalog: +version: '2' +catalog: name: "Drupal" - version: "v0.1-postgres" + version: "8.3.5-rancher1" description: "Blog tool, publishing platform and CMS" uuid: Drupal-0 minimum_rancher_version: v0.51.0 questions: - - variable: public_port + - variable: "PUBLIC_PORT" description: "public port to access the drupal site" label: "Public Port" required: true default: "15080" type: "int" + - variable: "DB_TYPE" + description: "public port to access the drupal site" + label: "DB type" + required: true + default: "postgres" + type: "enum" + options: + - "mysql" + - "postgres" + - variable: "DB_NAME" description: "Database Name to use for the server" label: "DB Name" @@ -32,6 +43,34 @@ required: true default: "" type: "password" - -drupal: - retain_ip: true +services: + drupal: + retain_ip: true + scale: 1 + health_check: + healthy_threshold: 2 + response_timeout: 5000 + port: 80 + unhealthy_threshold: 3 + interval: 5000 + strategy: recreate + request_line: GET / # HTTP/1.0 + drupal-lb: + scale: 1 + start_on_create: true + lb_config: + certs: [] + port_rules: + - priority: 1 + protocol: http + service: drupal + source_port: ${PUBLIC_PORT} + target_port: 80 + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 42 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + reinitializing_timeout: 60000 diff --git a/templates/drupal/config.yml b/templates/drupal/config.yml index bb0e086..0877efe 100644 --- a/templates/drupal/config.yml +++ b/templates/drupal/config.yml @@ -1,5 +1,5 @@ name: Drupal description: | Drupal is an open source CMS powering millions of websites and applications. -version: v0.1 +version: "8.3.5-rancher1" category: CMS