Dockerfile.alpine 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 index.html /speedtest/
  30. COPY index-classic.html /speedtest/
  31. COPY index-modern.html /speedtest/
  32. COPY config.json /speedtest/
  33. COPY favicon.ico /speedtest/
  34. COPY docker/*.php /speedtest/
  35. COPY docker/entrypoint.sh /
  36. # Prepare default environment variables
  37. ENV TITLE=LibreSpeed
  38. ENV TAGLINE="No Flash, No Java, No Websockets, No Bullsh*t"
  39. ENV MODE=standalone
  40. ENV PASSWORD=password
  41. ENV TELEMETRY=false
  42. ENV ENABLE_ID_OBFUSCATION=false
  43. ENV REDACT_IP_ADDRESSES=false
  44. ENV WEBPORT=8080
  45. ENV USE_NEW_DESIGN=false
  46. # https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
  47. STOPSIGNAL SIGWINCH
  48. # Add labels for better metadata
  49. LABEL org.opencontainers.image.title="LibreSpeed"
  50. LABEL org.opencontainers.image.description="A Free and Open Source speed test that you can host on your server(s)"
  51. LABEL org.opencontainers.image.vendor="LibreSpeed"
  52. LABEL org.opencontainers.image.url="https://github.com/librespeed/speedtest"
  53. LABEL org.opencontainers.image.source="https://github.com/librespeed/speedtest"
  54. LABEL org.opencontainers.image.documentation="https://github.com/librespeed/speedtest/blob/master/doc_docker.md"
  55. LABEL org.opencontainers.image.licenses="LGPL-3.0-or-later"
  56. # Add health check
  57. HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
  58. CMD wget --no-verbose --tries=1 --spider http://localhost:${WEBPORT}/ || exit 1
  59. WORKDIR /var/www/html
  60. # Final touches
  61. EXPOSE ${WEBPORT}
  62. CMD ["bash", "/entrypoint.sh"]