commit 0785209006a54c4f9b907ada1a11e061d27e6ed9 Author: rgcosta Date: Tue Aug 5 23:03:37 2025 +0000 Add Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc02239 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +FROM alpine:3.19 + +# ENVIRONMENT +ARG GRAV_VERSION="1.7.48" +ARG ALPINE_VERSION="3.19" +ARG PHP_VERSION="82" + +# AUTHOR +LABEL maintainer="Raul Costa " +LABEL description="Alpine + Nginx + PHP for Grav CMS" + +ENV GRAV_ROOT=/var/www/html \ + PHP_VERSION=${PHP_VERSION} \ + GRAV_VERSION=${GRAV_VERSION} \ + PHP_MEMORY_LIMIT=128M \ + UPLOAD_MAX_FILESIZE=10M \ + POST_MAX_SIZE=10M + + + +# INSTALLING +RUN apk add --no-cache \ + nginx \ + php${PHP_VERSION} php${PHP_VERSION}-fpm php${PHP_VERSION}-opcache \ + php${PHP_VERSION}-gd php${PHP_VERSION}-json php${PHP_VERSION}-mbstring \ + php${PHP_VERSION}-curl php${PHP_VERSION}-iconv php${PHP_VERSION}-fileinfo \ + php${PHP_VERSION}-xmlwriter php${PHP_VERSION}-xmlreader php${PHP_VERSION}-dom \ + php${PHP_VERSION}-session php${PHP_VERSION}-zip php${PHP_VERSION}-tokenizer \ + php${PHP_VERSION}-ctype php${PHP_VERSION}-openssl php${PHP_VERSION}-xml \ + php${PHP_VERSION}-intl php${PHP_VERSION}-simplexml \ + unzip curl su-exec bash + + + +# USER SETUP +RUN adduser -D -g 'Rocky User' -u 1001 rocky +RUN addgroup rocky tty + + +# CONFIGING CONFIG FILES +COPY config/nginx.conf /etc/nginx/nginx.conf +COPY config/php-fpm.conf /etc/php${PHP_VERSION}/php-fpm.d/www.conf + +# STARTING +COPY config/entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +EXPOSE 80 +VOLUME ["/var/www/html"] + +HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=4 \ + CMD curl --fail http://localhost || exit 1 + +ENTRYPOINT ["/entrypoint.sh"]