2023-09-22 20:54:11 +02:00
|
|
|
FROM alpine:3.18
|
2023-09-22 20:26:47 +02:00
|
|
|
|
|
|
|
LABEL Maintainer="Jabar Digital Service <digital.service@jabarprov.go.id>" \
|
|
|
|
Description="Lightweight container with Nginx 1.16 & PHP-FPM 7.4 based on Alpine Linux (forked from trafex/alpine-nginx-php7)."
|
|
|
|
|
|
|
|
#ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
|
|
|
|
|
|
|
|
# make sure you can use HTTPS
|
|
|
|
RUN apk --update add ca-certificates
|
|
|
|
|
|
|
|
#RUN echo "https://dl.bintray.com/php-alpine/v3.11/php-7.4" >> /etc/apk/repositories
|
|
|
|
|
|
|
|
# Install packages
|
2023-09-22 20:54:11 +02:00
|
|
|
RUN apk --no-cache add php82 php82-fpm php82-opcache php82-openssl php82-curl \
|
2023-09-22 20:26:47 +02:00
|
|
|
nginx supervisor curl unzip
|
|
|
|
|
|
|
|
# https://github.com/codecasts/php-alpine/issues/21
|
|
|
|
#RUN ln -s /usr/bin/php7 /usr/bin/php
|
|
|
|
|
|
|
|
# Configure nginx
|
|
|
|
COPY config/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
# Remove default server definition
|
2023-09-22 20:55:50 +02:00
|
|
|
# RUN rm /etc/nginx/conf.d/default.conf
|
2023-09-22 20:26:47 +02:00
|
|
|
|
|
|
|
# Configure PHP-FPM
|
|
|
|
COPY config/fpm-pool.conf /etc/php7/php-fpm.d/www.conf
|
|
|
|
COPY config/php.ini /etc/php7/conf.d/custom.ini
|
|
|
|
|
|
|
|
# Configure supervisord
|
|
|
|
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
|
2023-09-22 20:54:11 +02:00
|
|
|
# Setup documexnt root
|
2023-09-22 20:26:47 +02:00
|
|
|
RUN mkdir -p /var/www/html
|
|
|
|
#RUN mkdir -p /var/www/html/omeka-s
|
|
|
|
|
|
|
|
# Fetch Omeka-S
|
|
|
|
WORKDIR /tmp
|
|
|
|
ADD https://github.com/omeka/omeka-s/releases/download/v4.0.4/omeka-s-4.0.4.zip /tmp
|
|
|
|
RUN unzip omeka-s-4.0.4.zip -d /var/www/html/
|
|
|
|
|
|
|
|
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
|
|
|
|
RUN chown -R nobody.nobody /var/www/html && \
|
|
|
|
chown -R nobody.nobody /run && \
|
|
|
|
chown -R nobody.nobody /var/lib/nginx && \
|
|
|
|
chown -R nobody.nobody /var/log/nginx
|
|
|
|
|
|
|
|
|
|
|
|
# Switch to use a non-root user from here on
|
|
|
|
USER nobody
|
|
|
|
|
|
|
|
# Add application
|
|
|
|
# WORKDIR /var/www/html
|
|
|
|
# COPY --chown=nobody src/ /var/www/html/
|
|
|
|
|
|
|
|
# Expose the port nginx is reachable on
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
# Let supervisord start nginx & php-fpm
|
|
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
|
|
|
|
|
|
# Configure a healthcheck to validate that everything is up&running
|
|
|
|
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping
|