From 9852d3f53cdadb38e463f75e7825c1ac68a1458f Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Wed, 26 Jul 2017 16:48:55 +0800 Subject: [PATCH 1/6] persisting volume support, based on bitnami images --- templates/wordpress/1/docker-compose.yml | 29 +++++++++++++++++++++++ templates/wordpress/1/rancher-compose.yml | 26 ++++++++++++++++++++ templates/wordpress/config.yml | 2 +- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 templates/wordpress/1/docker-compose.yml create mode 100644 templates/wordpress/1/rancher-compose.yml diff --git a/templates/wordpress/1/docker-compose.yml b/templates/wordpress/1/docker-compose.yml new file mode 100644 index 0000000..c99aba0 --- /dev/null +++ b/templates/wordpress/1/docker-compose.yml @@ -0,0 +1,29 @@ +version: '2' +services: + mariadb: + image: 'bitnami/mariadb:latest' + volumes: + - 'mariadb_data:/bitnami' + environment: + - MARIADB_USER=bn_wordpress + - MARIADB_DATABASE=bitnami_wordpress + - ALLOW_EMPTY_PASSWORD=yes + wordpress: + image: 'bitnami/wordpress:latest' + ports: + - '${public_port}:80' + volumes: + - 'wordpress_data:/bitnami' + depends_on: + - mariadb + environment: + - MARIADB_HOST=mariadb + - MARIADB_PORT_NUMBER=3306 + - WORDPRESS_DATABASE_USER=bn_wordpress + - WORDPRESS_DATABASE_NAME=bitnami_wordpress + - ALLOW_EMPTY_PASSWORD=yes +volumes: + mariadb_data: + driver: rancher-nfs + wordpress_data: + driver: rancher-nfs \ No newline at end of file diff --git a/templates/wordpress/1/rancher-compose.yml b/templates/wordpress/1/rancher-compose.yml new file mode 100644 index 0000000..ad66201 --- /dev/null +++ b/templates/wordpress/1/rancher-compose.yml @@ -0,0 +1,26 @@ +.catalog: + name: "Wordpress" + version: "v0.2-bitnami" + description: "Blog tool, publishing platform and CMS based on bitnami images" + uuid: Wordpress-1 + minimum_rancher_version: v0.51.0 + questions: + - variable: public_port + description: "public port to access the wordpress site" + label: "Public Port" + required: true + default: "80" + type: "int" + - variable: "wordress_data" + description: "Data volume to save wordress data" + label: "Wordress data volume:" + required: true + default: "/var/lib/docker/wordress-data" + type: "string" + - variable: "mariadb_data" + description: "Data volume to save mariadb data" + label: "Mariadb data volume:" + required: true + default: "/var/lib/docker/mariadb-data" + type: "string" +wordpress: diff --git a/templates/wordpress/config.yml b/templates/wordpress/config.yml index 5f43d8b..eb08385 100644 --- a/templates/wordpress/config.yml +++ b/templates/wordpress/config.yml @@ -1,5 +1,5 @@ name: Wordpress description: | Blog tool, publishing platform and CMS -version: v0.1-educaas1 +version: v0.2-bitnami category: Blogging From 3ca99c82c89c5e1036c458deb9082c409b7f1986 Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Wed, 26 Jul 2017 16:54:35 +0800 Subject: [PATCH 2/6] remove unused config --- templates/wordpress/1/rancher-compose.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/templates/wordpress/1/rancher-compose.yml b/templates/wordpress/1/rancher-compose.yml index ad66201..9ab1cd4 100644 --- a/templates/wordpress/1/rancher-compose.yml +++ b/templates/wordpress/1/rancher-compose.yml @@ -11,16 +11,4 @@ required: true default: "80" type: "int" - - variable: "wordress_data" - description: "Data volume to save wordress data" - label: "Wordress data volume:" - required: true - default: "/var/lib/docker/wordress-data" - type: "string" - - variable: "mariadb_data" - description: "Data volume to save mariadb data" - label: "Mariadb data volume:" - required: true - default: "/var/lib/docker/mariadb-data" - type: "string" wordpress: From 93396bdba7bf39dbc5bbe4237c2fca9e645ee314 Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Wed, 26 Jul 2017 22:46:02 +0800 Subject: [PATCH 3/6] replace env infos with variables, add lb and healthcheck --- templates/wordpress/1/docker-compose.yml | 31 +++++----- templates/wordpress/1/rancher-compose.yml | 70 ++++++++++++++++++++++- 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/templates/wordpress/1/docker-compose.yml b/templates/wordpress/1/docker-compose.yml index c99aba0..9021b8d 100644 --- a/templates/wordpress/1/docker-compose.yml +++ b/templates/wordpress/1/docker-compose.yml @@ -1,29 +1,32 @@ version: '2' services: mariadb: - image: 'bitnami/mariadb:latest' + image: 'bitnami/mariadb:10.1' volumes: - 'mariadb_data:/bitnami' environment: - - MARIADB_USER=bn_wordpress - - MARIADB_DATABASE=bitnami_wordpress - - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_ROOT_PASSWORD=${mariadb_root_password} + - MARIADB_USER=${mariadb_user} + - MARIADB_PASSWORD=${mariadb_user_password} + - MARIADB_DATABASE=${mariadb_database_name} wordpress: - image: 'bitnami/wordpress:latest' - ports: - - '${public_port}:80' + image: 'bitnami/wordpress:4' volumes: - 'wordpress_data:/bitnami' depends_on: - mariadb environment: - - MARIADB_HOST=mariadb - - MARIADB_PORT_NUMBER=3306 - - WORDPRESS_DATABASE_USER=bn_wordpress - - WORDPRESS_DATABASE_NAME=bitnami_wordpress - - ALLOW_EMPTY_PASSWORD=yes + - WORDPRESS_DATABASE_NAME=${mariadb_database_name} + - WORDPRESS_DATABASE_USER=${mariadb_user} + - WORDPRESS_DATABASE_PASSWORD=${mariadb_user_password} + - WORDPRESS_USERNAME=${wordpress_username} + - WORDPRESS_PASSWORD=${wordpress_password} + wordpress-lb: + image: rancher/lb-service-haproxy:v0.7.5 + ports: + - ${public_port}:${public_port} volumes: mariadb_data: - driver: rancher-nfs + driver: ${volume_driver} wordpress_data: - driver: rancher-nfs \ No newline at end of file + driver: ${volume_driver} \ No newline at end of file diff --git a/templates/wordpress/1/rancher-compose.yml b/templates/wordpress/1/rancher-compose.yml index 9ab1cd4..5b62eeb 100644 --- a/templates/wordpress/1/rancher-compose.yml +++ b/templates/wordpress/1/rancher-compose.yml @@ -1,4 +1,5 @@ -.catalog: +version: '2' +catalog: name: "Wordpress" version: "v0.2-bitnami" description: "Blog tool, publishing platform and CMS based on bitnami images" @@ -11,4 +12,69 @@ required: true default: "80" type: "int" -wordpress: + - variable: mariadb_root_password + description: "MariaDB root password, set on first run" + label: "MariaDB Root Password" + required: true + default: "mariadb_my_root" + type: "string" + - variable: mariadb_user + description: "MariaDB database user, created on first run" + label: "MariaDB Database User" + required: true + default: "wordpress_user" + type: "string" + - variable: mariadb_user_password + description: "MariaDB database user password, set on first run" + label: "MariaDB Database User Password" + required: true + default: "wordpress_password" + type: "string" + - variable: wordpress_username + description: " WordPress application username" + label: "WordPress application password" + required: true + default: "admin" + type: "string" + - variable: wordpress_password + description: "WordPress application password" + label: "WordPress application password" + required: true + default: "bitnami" + type: "string" + - variable: volume_driver + description: "Volume driver to use with this service" + label: "Volume driver" + required: true + default: "local" + type: enum + options: + - local + - rancher-nfs + - rancher-efs + - rancher-ebs +services: + wordpress-lb: + scale: 1 + lb_config: + certs: [] + port_rules: + - protocol: http + service: wordpress + source_port: ${public_port} + target_port: 80 + health_check: + response_timeout: 2000 + healthy_threshold: 2 + port: 42 + unhealthy_threshold: 3 + wordpress: + scale: 1 + retain_ip: true + health_check: + port: 80 + interval: 5000 + unhealthy_threshold: 3 + request_line: 'GET / HTTP/1.0' + healthy_threshold: 2 + response_timeout: 5000 \ No newline at end of file From 56d961fc230f24a0fad19bc4cb0ecb7cc69f0f48 Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Thu, 27 Jul 2017 09:49:20 +0800 Subject: [PATCH 4/6] correct configs --- templates/wordpress/1/rancher-compose.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/wordpress/1/rancher-compose.yml b/templates/wordpress/1/rancher-compose.yml index 5b62eeb..a23a105 100644 --- a/templates/wordpress/1/rancher-compose.yml +++ b/templates/wordpress/1/rancher-compose.yml @@ -30,9 +30,15 @@ catalog: required: true default: "wordpress_password" type: "string" + - variable: mariadb_database_name + description: "Wordpress database name" + label: "Wordpress database name" + required: true + default: "bitnami_wordpress" + type: "string" - variable: wordpress_username - description: " WordPress application username" - label: "WordPress application password" + description: "WordPress application username" + label: "WordPress application username" required: true default: "admin" type: "string" @@ -72,7 +78,7 @@ services: scale: 1 retain_ip: true health_check: - port: 80 + port: 80 interval: 5000 unhealthy_threshold: 3 request_line: 'GET / HTTP/1.0' From 79383a528804b473e6f79f9b57072cfcbc914a28 Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Tue, 1 Aug 2017 11:44:53 +0800 Subject: [PATCH 5/6] Add readme --- templates/wordpress/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 templates/wordpress/README.md diff --git a/templates/wordpress/README.md b/templates/wordpress/README.md new file mode 100644 index 0000000..855556e --- /dev/null +++ b/templates/wordpress/README.md @@ -0,0 +1,12 @@ +## What is inside WordPress Stack? +* MariaDB Database +* WordPress (php/apache) +* Rancher Load Balancer (haproxy) + +## Info +* To persist website and database data, two volumes are created: mariadb_data, wordpress_data. +* You can choose from one of existing rancher volume types depending on your own environment. + +## Compatibility Notes + +* Version v0.2-bitnami has some known [issue](https://github.com/bitnami/bitnami-docker-testlink/issues/17#issuecomment-261783035) with Docker overlayfs and overlayfs2 storage driver. Please try to switch to aufs or devicemapper. \ No newline at end of file From 00036bccb76ed614a0f2e62785629918c57473e9 Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Tue, 1 Aug 2017 15:24:24 +0800 Subject: [PATCH 6/6] Update README.md --- templates/wordpress/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/wordpress/README.md b/templates/wordpress/README.md index 855556e..4de1c01 100644 --- a/templates/wordpress/README.md +++ b/templates/wordpress/README.md @@ -9,4 +9,4 @@ ## Compatibility Notes -* Version v0.2-bitnami has some known [issue](https://github.com/bitnami/bitnami-docker-testlink/issues/17#issuecomment-261783035) with Docker overlayfs and overlayfs2 storage driver. Please try to switch to aufs or devicemapper. \ No newline at end of file +* Version v0.2-bitnami has some known [issue](https://github.com/bitnami/bitnami-docker-testlink/issues/17#issuecomment-261783035) with Docker overlay and overlay2 storage driver. Please try to switch to aufs or devicemapper.