Dockerfile.alpine 2.0 KB

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