This commit is contained in:
jpmvaz
2026-09-13 20:27:51 +01:00
commit 37b00787b9
23 changed files with 2581 additions and 0 deletions
+134
View File
@@ -0,0 +1,134 @@
# ==============================================================================
# Documize Community Edition v5.14.0 — Docker Compose
# https://github.com/documize/community
#
# Stack:
# - documize-init one-shot downloader (runs once, then exits cleanly)
# - documize-app Alpine runner (executes the pre-downloaded binary)
# - MySQL 8 self-hosted database (named volume for persistence)
#
# Quick-start:
# 1. Copy .env.template to .env and fill in all ⚠️ values.
# 2. Run: docker compose up -d
# 3. Wait ~60 s, then open http://localhost:5001
# 4. Complete the one-time setup wizard in your browser.
#
# See README.docx for full documentation.
# ==============================================================================
services:
# ── MySQL 8 ──────────────────────────────────────────────────────────────────
db:
image: mysql:8
container_name: documize-db
restart: unless-stopped
mem_limit: 1g
cpu_shares: 1024
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "${MYSQL_USER}", "--password=${MYSQL_PASSWORD}"]
interval: 15s
timeout: 5s
retries: 5
start_period: 45s
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
# utf8mb4 + full-text search flags required by Documize
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--ft-min-word-len=3
--innodb-file-per-table=1
--max-allowed-packet=256M
volumes:
- db_data:/var/lib/mysql
networks:
- documize_net
# ── Init container: download binary once into shared volume ──────────────────
app-init:
image: alpine:3.19
container_name: documize-init
restart: "no" # runs once and exits — never restarts
entrypoint: ["/bin/sh", "-c"]
command:
- |
set -e
apk add --no-cache curl ca-certificates
if [ ! -f /app/bin/documize ]; then
echo 'Downloading Documize Community v5.14.0...'
curl -fsSL -o /app/bin/documize https://community-downloads.s3.us-east-2.amazonaws.com/documize-community-linux-amd64
chmod +x /app/bin/documize
echo 'Download complete.'
else
echo 'Binary already present, skipping download.'
fi
volumes:
- app_bin:/app/bin
# ── App: run the pre-downloaded binary ───────────────────────────────────────
app:
image: alpine:3.19
container_name: documize-app
restart: unless-stopped
entrypoint: ["/app/bin/documize"]
depends_on:
app-init:
condition: service_completed_successfully
db:
condition: service_healthy
ports:
- "${DOCUMIZE_PORT}:5001"
environment:
# ── Network ────────────────────────────────────────────────────────────
DOCUMIZEPORT: "${DOCUMIZE_PORT}"
DOCUMIZELOCATION: selfhost
# ── Database (MySQL DSN) ────────────────────────────────────────────────
DOCUMIZEDBTYPE: mysql
DOCUMIZEDB: "${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(db:3306)/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True&maxAllowedPacket=4194304"
# ── Security ────────────────────────────────────────────────────────────
DOCUMIZESALT: "${DOCUMIZE_SALT}"
# ── SMTP (optional — only active when all SMTP_* vars are set) ──────────
DOCUMIZESMTPHOST: "${SMTP_HOST}"
DOCUMIZESMTPPORT: "${SMTP_PORT}"
DOCUMIZESMTPUSER: "${SMTP_USER}"
DOCUMIZESMTPPASSWORD: "${SMTP_PASSWORD}"
DOCUMIZESMTPSENDER: "${SMTP_SENDER}"
volumes:
- app_bin:/app/bin
networks:
- documize_net
# ── Named volumes ─────────────────────────────────────────────────────────────
volumes:
db_data:
driver: local # MySQL data — survives container restarts and upgrades
app_bin:
driver: local # Documize binary — downloaded once by app-init
# ── Internal network ──────────────────────────────────────────────────────────
networks:
documize_net:
driver: bridge