Dockerfile.alpine 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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/*.php /speedtest/
  37. COPY docker/entrypoint.sh /
  38. # Prepare default environment variables
  39. ENV TITLE=LibreSpeed
  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"]