speedtest/Dockerfile
rare-magma 301e3f5234
fix: purge php src
Signed-off-by: rare-magma <rare-magma@posteo.eu>
2024-06-02 16:34:41 +02:00

53 lines
1.3 KiB
Docker
Executable File

FROM php:8-apache
# Install extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libpq-dev \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_mysql pdo_pgsql pgsql \
&& rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \
&& apt-get remove -y libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libpq-dev \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Prepare files and folders
RUN mkdir -p /speedtest/
# Copy sources
COPY backend/ /speedtest/backend
COPY results/*.php /speedtest/results/
COPY results/*.ttf /speedtest/results/
COPY *.js /speedtest/
COPY favicon.ico /speedtest/
COPY docker/servers.json /servers.json
COPY docker/*.php /speedtest/
COPY docker/entrypoint.sh /
# Prepare default environment variables
ENV TITLE=LibreSpeed
ENV MODE=standalone
ENV PASSWORD=password
ENV TELEMETRY=false
ENV ENABLE_ID_OBFUSCATION=false
ENV REDACT_IP_ADDRESSES=false
ENV WEBPORT=80
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
# Final touches
EXPOSE 80
CMD ["bash", "/entrypoint.sh"]