1
0

Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. FROM php:8-apache
  2. # use docker-php-extension-installer for automatically get the right packages installed
  3. ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
  4. # Install extensions and cleanup in a single layer to reduce image size
  5. RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql \
  6. && rm -f /usr/src/php.tar.xz /usr/src/php.tar.xz.asc \
  7. && apt-get autoremove -y \
  8. && apt-get clean \
  9. && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
  10. # Prepare files and folders
  11. RUN mkdir -p /speedtest/
  12. # Copy sources
  13. COPY backend/ /speedtest/backend
  14. COPY frontend/ /speedtest/frontend
  15. COPY results/*.php /speedtest/results/
  16. COPY results/*.ttf /speedtest/results/
  17. COPY *.js /speedtest/
  18. COPY index.html /speedtest/
  19. COPY index-classic.html /speedtest/
  20. COPY index-modern.html /speedtest/
  21. COPY config.json /speedtest/
  22. COPY stability.html /speedtest/
  23. COPY favicon.ico /speedtest/
  24. COPY manifest.webmanifest /speedtest/
  25. COPY images/ /speedtest/images/
  26. COPY docker/entrypoint.sh /
  27. # Prepare default environment variables
  28. ENV TITLE=LibreSpeed
  29. ENV TAGLINE="No Flash, No Java, No Websockets, No Bullsh*t"
  30. ENV MODE=standalone
  31. ENV PASSWORD=password
  32. ENV TELEMETRY=false
  33. ENV ENABLE_ID_OBFUSCATION=false
  34. ENV REDACT_IP_ADDRESSES=false
  35. ENV WEBPORT=8080
  36. ENV USE_NEW_DESIGN=false
  37. # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
  38. STOPSIGNAL SIGWINCH
  39. # Add labels for better metadata
  40. LABEL org.opencontainers.image.title="LibreSpeed"
  41. LABEL org.opencontainers.image.description="A Free and Open Source speed test that you can host on your server(s)"
  42. LABEL org.opencontainers.image.vendor="LibreSpeed"
  43. LABEL org.opencontainers.image.url="https://github.com/librespeed/speedtest"
  44. LABEL org.opencontainers.image.source="https://github.com/librespeed/speedtest"
  45. LABEL org.opencontainers.image.documentation="https://github.com/librespeed/speedtest/blob/master/doc_docker.md"
  46. LABEL org.opencontainers.image.licenses="LGPL-3.0-or-later"
  47. # Add health check
  48. HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
  49. CMD curl -f http://localhost:${WEBPORT}/ || exit 1
  50. # Final touches
  51. EXPOSE ${WEBPORT}
  52. CMD ["bash", "/entrypoint.sh"]