From e3091ac8ede33875aefc2350ec7e02a8a7ee6ab5 Mon Sep 17 00:00:00 2001 From: Kevin Xu Date: Thu, 15 Dec 2016 21:22:04 -0800 Subject: [PATCH] Removed use of rancher-nfs and use data containers instead. --- .../apache-guacamole/0/docker-compose.yml | 76 ++++++++++--------- .../apache-guacamole/0/rancher-compose.yml | 4 +- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/templates/apache-guacamole/0/docker-compose.yml b/templates/apache-guacamole/0/docker-compose.yml index 0db26a8..d35bb68 100644 --- a/templates/apache-guacamole/0/docker-compose.yml +++ b/templates/apache-guacamole/0/docker-compose.yml @@ -1,50 +1,52 @@ version: '2' -volumes: - db: - driver: rancher-nfs services: - guacamole: - image: glyptodon/guacamole + database: + image: mariadb environment: - MYSQL_HOSTNAME: database - MYSQL_DATABASE: ${guacamole_db} - MYSQL_PASSWORD: ${guacamole_password} - MYSQL_USER: ${guacamole_user} - command: - - /bin/bash - - -c - - "cd /usr/local/tomcat/webapps;rm -rf ROOT/; ln -s guacamole.war ROOT.war; /opt/guacamole/bin/start.sh;" - ports: - - ${public_port}:8080 - links: - - guacd:guacd - depends_on: - - database - guacd: - image: glyptodon/guacd + MYSQL_DATABASE: guacamole_db + MYSQL_ONETIME_PASSWORD: 'true' + MYSQL_PASSWORD: guacamole_password + MYSQL_RANDOM_ROOT_PASSWORD: 'true' + MYSQL_USER: guacamole_user + volumes_from: + - db-data + labels: + io.rancher.sidekicks: setup-get-db-script,db-data setup-get-db-script: image: glyptodon/guacamole - volumes: - - /docker-entrypoint-initdb.d + network_mode: none + volumes_from: + - db-data command: - bash - -c - /opt/guacamole/bin/initdb.sh --mysql > /docker-entrypoint-initdb.d/initdb.sql labels: io.rancher.container.start_once: 'true' - database: + db-data: image: mariadb - environment: - MYSQL_DATABASE: ${guacamole_db} - MYSQL_ONETIME_PASSWORD: 'true' - MYSQL_PASSWORD: ${guacamole_password} - MYSQL_RANDOM_ROOT_PASSWORD: 'true' - MYSQL_USER: ${guacamole_user} - labels: - io.rancher.sidekicks: setup-get-db-script - depends_on: - - setup-get-db-script - volumes_from: - - setup-get-db-script + network_mode: none volumes: - - db:/var/lib/mysql \ No newline at end of file + - /var/lib/mysql + - /docker-entrypoint-initdb.d + command: + - /bin/echo + labels: + io.rancher.container.start_once: 'true' + guacd: + image: glyptodon/guacd + guacamole: + image: glyptodon/guacamole + environment: + MYSQL_DATABASE: guacamole_db + MYSQL_HOSTNAME: database + MYSQL_PASSWORD: guacamole_password + MYSQL_USER: guacamole_user + links: + - guacd:guacd + ports: + - 8080:8080/tcp + command: + - /bin/bash + - -c + - cd /usr/local/tomcat/webapps;rm -rf ROOT/; ln -s guacamole.war ROOT.war; /opt/guacamole/bin/start.sh; \ No newline at end of file diff --git a/templates/apache-guacamole/0/rancher-compose.yml b/templates/apache-guacamole/0/rancher-compose.yml index 0f757ea..cbe0ddd 100644 --- a/templates/apache-guacamole/0/rancher-compose.yml +++ b/templates/apache-guacamole/0/rancher-compose.yml @@ -25,7 +25,9 @@ services: reinitializing_timeout: 60000 setup-get-db-script: scale: 1 - mysql: + db-data: + scale: 1 + database: scale: 1 health_check: healthy_threshold: 2