4490ee77d6
Fase 1 hardening (2026-07-08) moved saved QR code storage from src/saved_qrcode/ to /var/www/qrcode-storage/ (outside the webroot, SAVED_QRCODE_DIRECTORY in config.php), but docker-compose.yml's volume mount was never updated and still pointed at the old path (/var/www/html/saved_qrcode). The named volume was therefore mounted somewhere the app never wrote to - every actual qr code image the app generates at /var/www/qrcode-storage/ lived only in the container's ephemeral filesystem and was silently lost on every container recreation, while the qrcode_storage volume itself stayed permanently empty. DB rows (filenames/content) were never affected, only the generated image files. Confirmed as the cause of qr.ensembia.com's "old and new QR codes not showing in the list" report: qrcode_image.php's is_file() check failed because the file genuinely wasn't there anymore. docker-compose.prod.yml already had the correct path - only the dev compose file (what qr.ensembia.com actually runs) had this bug. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fo3DiRRpmz2DXjD7Uzhc8u
54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
services:
|
|
php-dynamic-qrcode:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: "unless-stopped"
|
|
environment:
|
|
TYPE: "${TYPE:-docker}"
|
|
QRCODE_GENERATOR: "${QRCODE_GENERATOR:-internal-chillerlan.qrcode}"
|
|
BASE_URL: "${BASE_URL:-http://localhost}"
|
|
DATABASE_HOST: "php-dynamic-qrcode-db"
|
|
DATABASE_PORT: "3306"
|
|
DATABASE_NAME: "${DATABASE_NAME:-qrcode}"
|
|
DATABASE_USER: "${DATABASE_USER:-qrcode}"
|
|
DATABASE_PASSWORD: "${DATABASE_PASSWORD:?zet DATABASE_PASSWORD in .env}"
|
|
DATABASE_PREFIX: "${DATABASE_PREFIX:-}"
|
|
DATABASE_CHARSET: "${DATABASE_CHARSET:-utf8}"
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
php-dynamic-qrcode-db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- php_dynamic_qrcode_saved_qrcode_data:/var/www/qrcode-storage
|
|
networks:
|
|
- php-dynamic-qrcode-network
|
|
|
|
php-dynamic-qrcode-db:
|
|
image: "mysql:8.0"
|
|
restart: "unless-stopped"
|
|
volumes:
|
|
- php_dynamic_qrcode_db_data:/var/lib/mysql
|
|
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD:?zet MYSQL_ROOT_PASSWORD in .env}"
|
|
MYSQL_DATABASE: "${DATABASE_NAME:-qrcode}"
|
|
MYSQL_USER: "${DATABASE_USER:-qrcode}"
|
|
MYSQL_PASSWORD: "${DATABASE_PASSWORD:?zet DATABASE_PASSWORD in .env}"
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
networks:
|
|
- php-dynamic-qrcode-network
|
|
|
|
volumes:
|
|
php_dynamic_qrcode_db_data:
|
|
php_dynamic_qrcode_saved_qrcode_data:
|
|
|
|
networks:
|
|
php-dynamic-qrcode-network:
|
|
driver: bridge
|