Files
Plenario/Dockerfile
T
gnilebeinandClaude Sonnet 5.5 7fa33bbbdd
CI / Deploy / PHP 8.4 (push) Successful in 1m11s
CI / Deploy / PHP 8.5 (push) Successful in 1m12s
CI / Deploy / test (push) Successful in 1s
CI / Deploy / deploy (push) Skipped
Drop app_local.php from production and show the mail transport in polls remind
app_local.php takes precedence over config/.env, so a copy made from an older
template forced the file transport and reminders never left the server.
Release package and Docker image now ship without it; app.php reads the
database from DATABASE_URL (SQLite default). app_local.example.php keeps
development defaults only. polls remind prints the transport and warns when
SMTP_HOST is set but SMTP is not used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 14:52:58 +01:00

45 lines
1.8 KiB
Docker

# PlenarIO container: PHP's built-in server via `bin/cake server`, app in /app, SQLite in /data.
# Configuration only through environment variables (see config/.env.example).
FROM php:8.5-cli-alpine AS base
# gd with JPEG/WebP: slide images are scaled and stored as WebP
RUN apk add --no-cache icu-libs libjpeg-turbo libpng libwebp \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS icu-dev libjpeg-turbo-dev libpng-dev libwebp-dev \
&& docker-php-ext-configure gd --with-jpeg --with-webp \
&& docker-php-ext-install -j"$(nproc)" intl gd \
&& apk del .build-deps
# Image uploads of up to 10 MB (IMAGE_MAX_UPLOAD_MB) must pass PHP's limits
RUN printf 'upload_max_filesize=10M\npost_max_size=12M\n' > /usr/local/etc/php/conf.d/plenario-uploads.ini
FROM base AS build
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /app
COPY composer.json composer.lock ./
# --no-scripts: no app_local.php in the image; everything comes from the environment at runtime
RUN composer install --no-dev --no-scripts --no-progress --prefer-dist --optimize-autoloader
COPY . .
RUN composer dump-autoload --no-dev --optimize
FROM base
WORKDIR /app
COPY --from=build /app /app
COPY docker/entrypoint.sh /usr/local/bin/plenario-entrypoint
ENV DEBUG=false \
SHOW_ADMIN_LINK_AFTER_CREATE=false \
DATABASE_URL=sqlite:////data/plenario.sqlite \
UPLOADS_PATH=/data/uploads \
PHP_CLI_SERVER_WORKERS=8
RUN chmod +x /usr/local/bin/plenario-entrypoint \
&& mkdir -p /data /app/tmp /app/logs \
&& chown -R www-data:www-data /data /app/tmp /app/logs
USER www-data
VOLUME /data
EXPOSE 8765
# static file: the Host-header check (APP_FULL_BASE_URL) would reject 127.0.0.1 on real pages
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
CMD wget -q -O /dev/null http://127.0.0.1:8765/css/plenario.css || exit 1
ENTRYPOINT ["plenario-entrypoint"]