Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. FROM debian:stable-slim
  2. RUN apt update -y && \
  3. apt install -y --no-install-recommends --no-install-suggests nginx supervisor wget \
  4. php8.2 php8.2-fpm php8.2-sqlite3 php8.2-xml php8.2-zip php8.2-pgsql php8.2-mbstring \
  5. php8.2-bcmath php8.2-mysql php8.2-gd php8.2-cli php8.2-curl php8.2-cgi && \
  6. mkdir -p /var/run/php /run/php /etc/nginx/cert && \
  7. wget https://raw.githubusercontent.com/hongwenjun/nginx-php/main/start.sh --no-check-certificate && \
  8. wget https://raw.githubusercontent.com/hongwenjun/nginx-php/main/default --no-check-certificate && \
  9. wget https://raw.githubusercontent.com/hongwenjun/nginx-php/main/supervisord.conf --no-check-certificate && \
  10. mv ./default /etc/nginx/sites-enabled/default && \
  11. mv ./supervisord.conf /etc/supervisord.conf && \
  12. chmod +x /start.sh && \
  13. ln -sf /dev/stdout /var/log/nginx/access.log && \
  14. ln -sf /dev/stderr /var/log/nginx/error.log && \
  15. echo "<?php phpinfo(); ?>" > /var/www/html/index.php && \
  16. apt remove -y wget && \
  17. rm -rf /var/lib/apt/lists/* /var/cache/apt && \
  18. cd /etc/php/8.2/fpm && \
  19. sed -i 's/post_max_size = 8M/post_max_size = 80M/g' php.ini && \
  20. sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 80M/g' php.ini
  21. EXPOSE 80/tcp 443/tcp
  22. # VOLUME [ /var/www/html /etc/nginx/conf.d /etc/nginx/cert ]
  23. # COPY ./default /etc/nginx/sites-enabled/default
  24. # COPY ./supervisord.conf /etc/supervisord.conf
  25. # COPY ./start.sh /start.sh
  26. CMD ["/start.sh"]