Dockerfile.alpine 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. FROM php:8-alpine
  2. RUN apk add --quiet --no-cache \
  3. bash \
  4. apache2 \
  5. php-apache2 \
  6. php-ctype \
  7. php-phar \
  8. php-gd \
  9. php-openssl \
  10. php-pdo \
  11. php-pdo_mysql \
  12. php-pdo_pgsql \
  13. php-pdo_sqlite \
  14. php-pgsql \
  15. php-session \
  16. php-sqlite3
  17. # # use docker-php-extension-installer for automatically get the right packages installed
  18. # ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
  19. # # Install extensions
  20. # RUN install-php-extensions iconv gd pdo pdo_mysql pdo_pgsql pgsql
  21. RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
  22. ln -sf /dev/stderr /var/log/apache2/error.log
  23. # Prepare files and folders
  24. RUN mkdir -p /speedtest/
  25. # Copy sources
  26. COPY backend/ /speedtest/backend
  27. COPY frontend/ /speedtest/frontend
  28. COPY results/*.php /speedtest/results/
  29. COPY results/*.ttf /speedtest/results/
  30. COPY *.js /speedtest/
  31. COPY stability.html /speedtest/
  32. COPY index.html /speedtest/
  33. COPY index-classic.html /speedtest/
  34. COPY index-modern.html /speedtest/
  35. COPY config.json /speedtest/
  36. COPY favicon.ico /speedtest/
  37. COPY docker/*.php /speedtest/
  38. COPY docker/entrypoint.sh /
  39. # Prepare default environment variables
  40. ENV TITLE=LibreSpeed
  41. ENV TAGLINE="No Flash, No Java, No Websockets, No Bullsh*t"
  42. ENV MODE=standalone
  43. ENV PASSWORD=password
  44. ENV TELEMETRY=false
  45. ENV ENABLE_ID_OBFUSCATION=false
  46. ENV REDACT_IP_ADDRESSES=false
  47. ENV WEBPORT=8080
  48. ENV USE_NEW_DESIGN=false
  49. # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
  50. STOPSIGNAL SIGWINCH
  51. # Add labels for better metadata
  52. LABEL org.opencontainers.image.title="LibreSpeed"
  53. LABEL org.opencontainers.image.description="A Free and Open Source speed test that you can host on your server(s)"
  54. LABEL org.opencontainers.image.vendor="LibreSpeed"
  55. LABEL org.opencontainers.image.url="https://github.com/librespeed/speedtest"
  56. LABEL org.opencontainers.image.source="https://github.com/librespeed/speedtest"
  57. LABEL org.opencontainers.image.documentation="https://github.com/librespeed/speedtest/blob/master/doc_docker.md"
  58. LABEL org.opencontainers.image.licenses="LGPL-3.0-or-later"
  59. # Add health check
  60. HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
  61. CMD wget --no-verbose --tries=1 --spider http://localhost:${WEBPORT}/ || exit 1
  62. WORKDIR /var/www/html
  63. # Final touches
  64. EXPOSE ${WEBPORT}
  65. CMD ["bash", "/entrypoint.sh"]