FROM docker:27-dind AS apache USER root RUN apk update && \ apk add --no-cache \ bash \ coreutils \ su-exec \ apache2 \ php83-apache2 \ php83-session RUN adduser -D apache2 && \ addgroup apache2 docker RUN mkdir -p /root/.docker && \ chmod -R 0777 /root/.docker RUN chmod 4755 /sbin/su-exec COPY --chmod=777 httpd-foreground /usr/local/bin/ COPY --chmod=777 entrypoint.sh /usr/local/bin/ COPY --chmod=777 . /opt/application COPY httpd.conf /etc/apache2/httpd.conf ENV IS_IN_DOCKER=1 EXPOSE 80 CMD ["/usr/local/bin/entrypoint.sh"]