From 656d8d554578191b918ca1c3fa4e02aaec02f065 Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Tue, 7 Jun 2022 21:43:21 +0200 Subject: [PATCH] adds more recipe stuff * secrets * extract admin_name and admin_email * unset BASE_URL env for me the it broke the url path actually, this setting (https://github.com/martialblog/docker-limesurvey/blob/master/5.0/apache/entrypoint.sh#L112) is not documented (https://manual.limesurvey.org/Optional_settings), so not sure what it actually does * backupbot labels --- .env.sample | 5 ++++- compose.yml | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.env.sample b/.env.sample index ac86068..c867406 100644 --- a/.env.sample +++ b/.env.sample @@ -7,6 +7,9 @@ DOMAIN=limesurvey.example.com LETS_ENCRYPT_ENV=production +ADMIN_EMAIL=admin@example.com +ADMIN_NAME=admin + SECRET_DB_PASSWORD_VERSION=v1 SECRET_DB_ROOT_PASSWORD_VERSION=v1 -SECRET_LIMESURVEY_ADMIN_PASSWORD_VERSION=v1 \ No newline at end of file +SECRET_LIMESURVEY_ADMIN_PASSWORD_VERSION=v1 diff --git a/compose.yml b/compose.yml index 0a2f167..d99117c 100644 --- a/compose.yml +++ b/compose.yml @@ -3,7 +3,7 @@ version: "3.8" services: app: - image: martialblog/limesurvey:5.2.9-220110-apache + image: martialblog/limesurvey:5.3.18-220530-apache depends_on: - db networks: @@ -12,9 +12,11 @@ services: environment: - "DB_HOST=${STACK_NAME}_db" - "DB_PASSWORD_FILE=/run/secrets/db_password" + - ADMIN_EMAIL + - ADMIN_NAME - "ADMIN_PASSWORD_FILE=/run/secrets/limesurvey_admin_password" - "PUBLIC_URL=https://${DOMAIN}" - - "BASE_URL=https://${DOMAIN}" + - "BASE_URL" configs: - source: entrypoint target: /usr/local/bin/custom-entrypoint.sh @@ -37,6 +39,8 @@ services: #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" - "coop-cloud.${STACK_NAME}.version=" + - "backupbot.backup=true" + - "backupbot.backup.path=/var/www/html/upload/surveys" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080"] interval: 30s @@ -57,6 +61,12 @@ services: secrets: - db_password - db_root_password + deploy: + labels: + backupbot.backup: "true" + backupbot.backup.pre-hook: 'mkdir -p /tmp/backup/ && mysqldump --single-transaction -u root -p"$$(cat /run/secrets/db_root_password)" limesurvey > /tmp/backup/backup.sql' + backupbot.backup.post-hook: "rm -rf /tmp/backup" + backupbot.backup.path: "/tmp/backup/" volumes: app: @@ -81,4 +91,4 @@ secrets: name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION} limesurvey_admin_password: external: true - name: ${STACK_NAME}_limesurvey_admin_password_${SECRET_LIMESURVEY_ADMIN_PASSWORD_VERSION} \ No newline at end of file + name: ${STACK_NAME}_limesurvey_admin_password_${SECRET_LIMESURVEY_ADMIN_PASSWORD_VERSION}