Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM php:8.2-fpm-alpine
  2. # Install required dependencies and Nginx
  3. RUN apk update && \
  4. apk add --no-cache \
  5. freetype-dev \
  6. libjpeg-turbo-dev \
  7. libpng-dev \
  8. libzip-dev \
  9. icu-dev \
  10. libgd \
  11. libwebp-dev \
  12. nginx \
  13. unzip \
  14. supervisor && \
  15. docker-php-ext-configure gd --with-freetype --with-jpeg && \
  16. docker-php-ext-configure intl && \
  17. docker-php-ext-install -j$(nproc) gd pdo_mysql zip intl mysqli && \
  18. apk del --no-cache freetype-dev libjpeg-turbo-dev libpng-dev && \
  19. mkdir -p /run/nginx
  20. # Copy PHP-FPM and Nginx configuration files
  21. COPY rootfs/php-fpm.conf /usr/local/etc/php-fpm.d/zz-zcustom.conf
  22. COPY rootfs/nginx.conf /etc/nginx/http.d/default.conf
  23. # Set working directory
  24. WORKDIR /var/www/html
  25. # Set up proper permissions
  26. RUN chown -R www-data:www-data /var/www/html
  27. # Expose the required ports
  28. EXPOSE 80
  29. # Copy and run the supervisord configuration
  30. COPY rootfs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  31. CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]