Dockerfile 1.2 KB

12345678910111213141516171819202122
  1. FROM alpine:3.21
  2. RUN apk add php84 php84-fpm php84-dom php84-curl php84-openssl nginx --no-cache
  3. RUN sed -i '/user nginx;/d' /etc/nginx/nginx.conf \
  4. && sed -i 's/^; user = nobody/user = nobody/' /etc/php84/php-fpm.d/www.conf \
  5. && sed -i 's/^; group = nobody/group = nobody/' /etc/php84/php-fpm.d/www.conf \
  6. && sed -i 's/listen = 127.0.0.1:9000/listen = \/run\/php\/php-fpm84.sock/' /etc/php84/php-fpm.d/www.conf \
  7. && sed -i 's/;listen.owner = nobody/listen.owner = nginx/' /etc/php84/php-fpm.d/www.conf \
  8. && sed -i 's/;listen.group = nobody/listen.group = nginx/' /etc/php84/php-fpm.d/www.conf \
  9. && sed -i 's/;listen.mode/listen.mode/' /etc/php84/php-fpm.d/www.conf \
  10. && sed -i 's/;listen.allowed_clients/listen.allowed_clients/' /etc/php84/php-fpm.d/www.conf
  11. RUN mkdir -p /var/www/binternet /run/php
  12. COPY . /var/www/binternet
  13. COPY nginx.conf /etc/nginx/http.d/binternet.conf
  14. RUN rm /var/www/binternet/nginx.conf /etc/nginx/http.d/default.conf \
  15. && chown -R nginx:nginx /var/log/php84/ /run
  16. USER nginx
  17. EXPOSE 8080
  18. ENTRYPOINT ["/bin/sh", "-c" , "/usr/sbin/php-fpm84 -D && /usr/sbin/nginx -c /etc/nginx/nginx.conf -g 'daemon off;'"]
  19. HEALTHCHECK --timeout=5s CMD wget --no-verbose --tries=1 --spider 127.0.0.1:8080 || exit 1