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