Files
novaconium/Dockerfile
T
code a0ae58c29e Add Media manager (/admin/media), remove unused images/ scaffolding
Upload/browse/delete UI for files under public/uploads/, covered by the
existing /admin/* auth gate with no separate feature flag needed (no
SQLite dependency to gate). Extension allowlist and max upload size are
configurable; filenames are sanitized and de-duplicated on upload, and
deletes re-verify the resolved path lands inside the upload directory
before touching disk. Docker gains a fourth-turned-third named volume
for public/uploads/ so uploads survive a rebuild.

images/ (reserved scaffolding for a future image feature) is removed —
nothing ever consumed it, and public/uploads/ now covers that use case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 07:35:45 +00:00

41 lines
1.6 KiB
Docker

# Arch Linux + Apache + PHP image for running novaconium in production.
# See /admin/docs/docker for volumes, overriding App/ without a rebuild,
# and optional MySQL wiring.
FROM archlinux:base
RUN pacman -Syu --noconfirm --needed apache php php-apache sqlite \
&& pacman -Scc --noconfirm
# php-apache on Arch is built against mpm_prefork, not httpd's default
# mpm_event — swap MPMs, enable mod_rewrite, point DocumentRoot at
# public/, and wire in mod_php.
RUN sed -i \
-e 's/^LoadModule mpm_event_module/#LoadModule mpm_event_module/' \
-e 's/^#LoadModule mpm_prefork_module/LoadModule mpm_prefork_module/' \
-e '/^#LoadModule rewrite_module/s/^#//' \
-e 's#DocumentRoot "/srv/http"#DocumentRoot "/var/www/html/public"#' \
-e 's#<Directory "/srv/http">#<Directory "/var/www/html/public">#' \
-e 's/^AllowOverride None/AllowOverride All/' \
/etc/httpd/conf/httpd.conf \
&& printf '\nLoadModule php_module modules/libphp.so\nAddHandler php-script .php\nDirectoryIndex index.php index.html\nServerName localhost\n' \
>> /etc/httpd/conf/httpd.conf \
&& sed -i \
-e 's/^;extension=pdo_sqlite/extension=pdo_sqlite/' \
-e 's/^;extension=pdo_mysql/extension=pdo_mysql/' \
/etc/php/php.ini
WORKDIR /var/www/html
COPY novaconium/ ./novaconium/
COPY public/ ./public/
COPY App/ ./App/
# Runtime-writable paths not covered by named volumes in docker-compose.yml.
RUN mkdir -p public/cache public/uploads data \
&& touch novaconium/contact-log.txt \
&& chown -R http:http public/cache public/uploads data App novaconium/contact-log.txt
EXPOSE 80
CMD ["httpd", "-D", "FOREGROUND"]