# The Old Fitz — production compose for the VPS. # # Expected layout, one folder per site: # theoldfitz/ # docker-compose.yaml (this file) # .env (optional, see PROXY_NETWORK below) # www/ (contents of `npm run dist`) # data/ (fitz.sqlite — never inside www/) # # First run: create data/ and `chown 33:33 data` (www-data in the image), # then create the first admin with bin/create-user.php (see its header). # # The CasaOS dev host keeps its own copy of this file in the CasaOS app # settings, with CasaOS paths and its x-casaos block. name: the-old-fitz networks: proxy: external: true # The reverse proxy's Docker network (NPM or Caddy). Set PROXY_NETWORK # in .env if it isn't called "proxy". name: ${PROXY_NETWORK:-proxy} services: the-old-fitz: image: php:8.5-apache container_name: the-old-fitz restart: unless-stopped # The image ships without a php.ini, so PHP falls back to dev-style # defaults and shows errors (with server paths) to visitors. Activate # the image's bundled production ini — display_errors off, errors to # the log — and hide the PHP version header, then start Apache as usual. # Paths are spelled out (the image's $PHP_INI_DIR) rather than using # the variable, so no $-escaping is needed. command: - bash - -c - cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini && echo 'expose_php = Off' > /usr/local/etc/php/conf.d/zz-hardening.ini && exec apache2-foreground networks: - proxy volumes: - type: bind source: ./www target: /var/www/html # Database lives outside the web root so Apache can't serve it. - type: bind source: ./data target: /var/www/data environment: - TZ=America/Indiana/Indianapolis - FITZ_DB_PATH=/var/www/data/fitz.sqlite # Cap container logs so PHP's error log can't slowly fill the disk. logging: driver: json-file options: max-size: 10m max-file: "3"