42 lines
2.0 KiB

FROM alpine:3.18
WORKDIR "/var/www/html"
ADD "." "."
# Docker metadata contains information about the maintainer, such as the name, repository, and support email
# See more:
LABEL name="LibreY" \
description="Framework and javascript free privacy respecting meta search engine" \
version="1.0" \
vendor="Ahwx <>" \
maintainer="Ahwx <>" \
url="" \
# Include arguments as temporary environment variables to be handled by Docker during the image build process
# Change or add new arguments to customize the image generated by 'docker build' command
# Set this argument during build time to indicate that the path is for php's www.conf
ARG WWW_CONFIG="/etc/php82/php-fpm.d/www.conf"
# Customize the environment during both execution and build time by modifying the environment variables added to the container's shell
# When building your image, make sure to set the 'TZ' environment variable to your desired time zone location, for example 'America/Sao_Paulo'
# See more:
ENV TZ="America/New_York"
# Install required packages
RUN apk add gettext php82 php82-fpm php82-dom php82-curl php82-json php82-apcu nginx --no-cache
# Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient
RUN touch /run/php-fpm82.sock && chown nginx:nginx "/run/php-fpm82.sock"
RUN sed -i 's/^\s*listen = = \/run\/php-fpm82.sock/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s*listen.owner = nobody/listen.owner = nginx/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s* = nobody/ = nginx/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG}
# Configures the container to be run as an executable.
ENTRYPOINT ["/bin/sh", "-c", "docker/"]