| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- FROM php:8-alpine
- # Use the mlocati helper to install PHP extensions in a platform-agnostic way.
- ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
- # Install runtime packages and let the helper install/compile PHP extensions
- RUN apk add --quiet --no-cache \
- bash \
- apache2 \
- wget \
- curl \
- build-base \
- autoconf \
- libpng-dev \
- libjpeg-turbo-dev \
- libwebp-dev \
- freetype-dev \
- libxml2-dev \
- mariadb-connector-c-dev \
- postgresql-dev \
- sqlite-dev \
- && install-php-extensions gd pdo pdo_mysql pdo_pgsql pdo_sqlite pgsql zip
- # Note: PHP extensions are provided via Alpine `php-*` packages above.
- # The docker-php-extension-installer is redundant when using those packages,
- # so it's intentionally removed to simplify the image.
- RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
- ln -sf /dev/stderr /var/log/apache2/error.log
- # 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=8080
- # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
- STOPSIGNAL SIGWINCH
- # Add labels for better metadata
- LABEL org.opencontainers.image.title="LibreSpeed"
- LABEL org.opencontainers.image.description="A Free and Open Source speed test that you can host on your server(s)"
- LABEL org.opencontainers.image.vendor="LibreSpeed"
- LABEL org.opencontainers.image.url="https://github.com/librespeed/speedtest"
- LABEL org.opencontainers.image.source="https://github.com/librespeed/speedtest"
- LABEL org.opencontainers.image.documentation="https://github.com/librespeed/speedtest/blob/master/doc_docker.md"
- LABEL org.opencontainers.image.licenses="LGPL-3.0-or-later"
- # Add health check
- HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
- CMD wget --no-verbose --tries=1 --spider http://localhost:${WEBPORT}/ || exit 1
- WORKDIR /var/www/html
- # Final touches
- EXPOSE ${WEBPORT}
- CMD ["bash", "/entrypoint.sh"]
|