limesurvey/compose.yml

94 lines
2.9 KiB
YAML

---
version: "3.8"
services:
app:
image: martialblog/limesurvey:5.3.18-220530-apache
depends_on:
- db
networks:
- proxy
- internal
environment:
- "DB_HOST=${STACK_NAME}_db"
- "DB_TYPE=pgsql"
- "DB_PORT=5432"
- "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"
configs:
- source: entrypoint
target: /usr/local/bin/custom-entrypoint.sh
mode: 0555
secrets:
- db_password
- limesurvey_admin_password
entrypoint: /usr/local/bin/custom-entrypoint.sh
volumes:
- config:/var/www/html/application/config
- app:/var/www/html/upload/surveys
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
## Redirect from EXTRA_DOMAINS to DOMAIN
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=0.1.0+5.3.18-220530-apache"
- "backupbot.backup=true"
- "backupbot.backup.path=/var/www/html/upload/surveys,/var/www/html/application/config"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
db:
image: postgres:14-alpine
networks:
- internal
environment:
- POSTGRES_DB=limesurvey
- POSTGRES_USER=limesurvey
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
secrets:
- db_password
volumes:
- postgres:/var/lib/postgresql/data
deploy:
labels:
backupbot.backup: "true"
backupbot.backup.pre-hook: "mkdir -p /tmp/backup/ && PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /tmp/backup/backup.sql"
backupbot.backup.post-hook: "rm -rf /tmp/backup"
backupbot.backup.path: "/tmp/backup/"
volumes:
app:
config:
postgres:
networks:
proxy:
external: true
internal:
configs:
entrypoint:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
file: entrypoint.sh
secrets:
db_password:
external: true
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}