Dockerfile.alpine 2.1 KB

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