Dockerfile.alpine 2.2 KB

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