Slides (except YouTube) can carry one image. Uploads are validated, rotated by EXIF orientation, scaled to 1600 px and stored as WebP outside webroot, which also strips camera metadata. Images have an alt text (or are marked decorative) and a layout: top, side or full screen (content slides). Files are removed after the commit when a slide is deleted or its image is replaced, with the poll, and `bin/cake images_cleanup` sweeps leftovers. Duplicated slides get their own file. Docker image gains gd with WebP. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
46 lines
1.9 KiB
Docker
46 lines
1.9 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: the installer must not bake a random salt into app_local.php (SECURITY_SALT comes at runtime)
|
|
RUN composer install --no-dev --no-scripts --no-progress --prefer-dist --optimize-autoloader
|
|
COPY . .
|
|
RUN composer dump-autoload --no-dev --optimize \
|
|
&& cp config/app_local.example.php config/app_local.php
|
|
|
|
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"]
|