Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. FROM php:8.3-apache
  2. RUN apt-get update && apt-get install -y --no-install-recommends \
  3. libfreetype6-dev \
  4. libjpeg62-turbo-dev \
  5. libpng-dev \
  6. libzip-dev \
  7. ffmpeg \
  8. && docker-php-ext-configure gd --with-freetype --with-jpeg \
  9. && docker-php-ext-install -j$(nproc) gd mysqli pdo_mysql zip exif opcache \
  10. && a2enmod rewrite deflate expires \
  11. && rm -rf /var/lib/apt/lists/*
  12. RUN printf '%s\n' \
  13. 'short_open_tag=On' \
  14. 'memory_limit=256M' \
  15. 'upload_max_filesize=64M' \
  16. 'post_max_size=64M' \
  17. 'max_input_vars=5000' \
  18. 'variables_order=EGPCS' \
  19. > /usr/local/etc/php/conf.d/una.ini
  20. # The bundled static plugins/ffmpeg/ffmpeg.exe segfaults on URL inputs (it resolves
  21. # hostnames with static glibc), which broke every video poster. Run Debian's ffmpeg instead.
  22. # Error reports by email are for ci.una.io; a preview would mail on every request.
  23. ENV UNA_FFMPEG_PATH=/usr/bin/ffmpeg \
  24. UNA_DEBUG_EMAIL_REPORT=0
  25. COPY --chown=www-data:www-data . /var/www/html
  26. # plugins/ffmpeg/ffmpeg.exe stays: the installer's permission check requires it to be
  27. # executable, although UNA_FFMPEG_PATH means it never runs.
  28. RUN mv /var/www/html/entrypoint.sh /usr/local/bin/entrypoint.sh \
  29. && chmod +x /usr/local/bin/entrypoint.sh \
  30. && mkdir -p /usr/local/lib/una-railway \
  31. && mv /var/www/html/configure.php /var/www/html/seed.php /usr/local/lib/una-railway/ \
  32. && rm -f /var/www/html/Dockerfile /var/www/html/railway.toml \
  33. && mkdir -p /var/www/html/cache /var/www/html/cache_public /var/www/html/logs /var/www/html/tmp /var/www/html/storage \
  34. && chown -R www-data:www-data \
  35. /var/www/html/inc \
  36. /var/www/html/cache \
  37. /var/www/html/cache_public \
  38. /var/www/html/logs \
  39. /var/www/html/tmp \
  40. /var/www/html/storage \
  41. && if [ -f /var/www/html/plugins/ffmpeg/ffmpeg.exe ]; then chmod 0755 /var/www/html/plugins/ffmpeg/ffmpeg.exe; fi
  42. WORKDIR /var/www/html
  43. ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
  44. CMD ["apache2-foreground"]