Package xwiki

This commit is contained in:
tobias 2024-10-17 23:52:22 +09:00
parent 19f93414b7
commit 70f026edf6
2 changed files with 46 additions and 2 deletions

View File

@ -6,3 +6,7 @@ DOMAIN=xwiki.example.com
#EXTRA_DOMAINS=', `www.xwiki.example.com`' #EXTRA_DOMAINS=', `www.xwiki.example.com`'
LETS_ENCRYPT_ENV=production LETS_ENCRYPT_ENV=production
SECRET_DB_USERNAME_VERSION=v1
SECRET_DB_PASSWORD_VERSION=v1
SECRET_DB_ROOT_PASSWORD_VERSION=v1

View File

@ -3,7 +3,17 @@ version: "3.8"
services: services:
app: app:
image: nginx:1.20.0 image: "xwiki:stable-mysql-tomcat"
environment:
- DB_USER_FILE=/run/secrets/db_username
- DB_PASSWORD_FILE=/run/secrets/db_password
- DB_DATABASE=xwiki
- DB_HOST=db
volumes:
- xwiki-data:/usr/local/xwiki
secrets:
- db_username
- db_password
networks: networks:
- proxy - proxy
deploy: deploy:
@ -11,7 +21,7 @@ services:
condition: on-failure condition: on-failure
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80" - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8080"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
@ -26,7 +36,37 @@ services:
timeout: 10s timeout: 10s
retries: 10 retries: 10
start_period: 1m start_period: 1m
db:
image: "mysql:9.1"
volumes:
- mysql-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
- MYSQL_USER_FILE=/run/secrets/db_username
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
- MYSQL_DATABASE=xwiki
command:
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_bin"
- "--explicit-defaults-for-timestamp=1"
secrets:
- db_username
- db_password
- db_root_password
networks: networks:
proxy: proxy:
external: true external: true
volumes:
mysql-data:
xwiki-data:
secrets:
db_username:
name: ${STACK_NAME}_db_username_${SECRET_DB_USERNAME_VERSION}
external: true
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
external: true
db_root_password:
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
external: true