Add Dockerfile
This commit is contained in:
54
Dockerfile
Normal file
54
Dockerfile
Normal file
@@ -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 <raul@rcosta.uk>"
|
||||
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"]
|
||||
Reference in New Issue
Block a user