Dockerfile.alpine 2.1 KB

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