# syntax = edrevo/dockerfile-plus ARG NGINX_VERSION="1.25" # Подключение PHP образов INCLUDE+ docker/app/Dockerfile FROM nginx:${NGINX_VERSION}-alpine AS nginx RUN rm -rf /var/www/* /etc/nginx/conf.d/* && adduser -u 1000 -D -S -G www-data www-data COPY docker/web/nginx/nginx-* /usr/local/bin/ COPY docker/web/nginx/ /etc/nginx/ RUN chown -R www-data /etc/nginx/ && chmod +x /usr/local/bin/nginx-* # The PHP-FPM Host ## Localhost is the sensible default assuming image run on a k8S Pod ENV PHP_FPM_HOST "localhost" ENV PHP_FPM_PORT "9000" ENV NGINX_LOG_FORMAT "json" # For Documentation EXPOSE 8080 # Switch User USER www-data # Add Healthcheck HEALTHCHECK CMD ["nginx-healthcheck"] # Add Entrypoint ENTRYPOINT ["nginx-entrypoint"] # ====================================================================================================================== # --- NGINX PROD --- # ====================================================================================================================== FROM nginx AS web USER root RUN SECURITY_UPGRADES="curl"; \ apk add --no-cache --upgrade ${SECURITY_UPGRADES} USER www-data # Copy Public folder + Assets that's going to be served from Nginx COPY --chown=www-data:www-data --from=app /app/public /app/public # ====================================================================================================================== # --- NGINX DEV --- # ====================================================================================================================== FROM nginx AS web-dev ENV NGINX_LOG_FORMAT "combined" COPY --chown=www-data:www-data docker/web/nginx/dev/*.conf /etc/nginx/conf.d/ COPY --chown=www-data:www-data docker/web/nginx/dev/certs/ /etc/nginx/certs/