I am very new to the docker. This is my first individual Dockfile. After running this Dockerfile my website continue shows 502 Bad Gateway. The status shows unhealthy after running for a minute.
FROM composer as builder
ARG PHP_FPM_VER=8.2
LABEL maintainer=”tan <@gmail.com>”
WORKDIR /app
COPY conf/composer.json /app/
RUN composer install –no-dev –optimize-autoloader –no-interaction
FROM php:8.2-fpm-alpine
RUN apk add –no-cache nginx curl libzip-dev
&& docker-php-ext-install zip pdo pdo_mysql
&& apk add –no-cache supervisor curl
COPY conf/nginx.conf /etc/nginx/nginx.conf
COPY conf/supervisord.conf /etc/supervisord.conf
COPY –from=builder /app/vendor /var/www/vendor
COPY src /var/www/html
HEALTHCHECK –interval=30s –timeout=10s –start-period=10s –retries=3
CMD curl -f http://localhost/ || exit 1
EXPOSE 80
VOLUME /var/www/html
CMD [“nginx”, “-g”, “daemon off;”]
I have tried add supervisord.conf, rewrite Health Check Command. They did not work.
Peiting is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.