Add PHP support

Signed-off-by: Emmy D'Anello <emmy@luemy.eu>
This commit is contained in:
2025-02-25 22:57:16 +01:00
parent b46254ff82
commit 0440fc6144
3 changed files with 56 additions and 4 deletions

View File

@@ -1,7 +1,10 @@
FROM python:3-alpine
RUN apk --update add git nginx && \
rm /var/cache/apk/*
ARG PHP_ENABLED
ENV PHP_ENABLED=${PHP_ENABLED}
ENV NGINX_SERVER_GIT_URL=""
RUN apk add --no-cache git nginx rsync; if [[ -n "$PHP_ENABLED" ]]; then apk add --no-cache php-fpm php-session php-pdo_mysql; fi
RUN pip install requests --no-cache-dir
@@ -10,13 +13,16 @@ RUN mkdir -p /var/www/html
# Configure nginx
RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
COPY nginx.conf /etc/nginx/http.d/mkdocs-server.conf
RUN rm /etc/nginx/http.d/default.conf
COPY nginx*.conf /tmp/
RUN if [[ -z "$PHP_ENABLED" ]]; then cp /tmp/nginx.conf /etc/nginx/http.d/server.conf; else cp /tmp/nginx-php.conf /etc/nginx/http.d/server-php.conf; fi; rm /etc/nginx/http.d/default.conf
COPY ./entrypoint.sh /hook
COPY ./docker-hook /hook
COPY ./update.sh /hook
RUN mkdir /conf
VOLUME /conf
WORKDIR /var/www/html
ENTRYPOINT ["/hook/entrypoint.sh"]