Dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Default Dockerfile
  2. #
  3. # @link https://www.hyperf.io
  4. # @document https://hyperf.wiki
  5. # @contact group@hyperf.io
  6. # @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
  7. ARG PHP_VERSION
  8. ARG ALPINE_VERSION
  9. FROM hyperf/hyperf:${PHP_VERSION}-alpine-${ALPINE_VERSION}-swoole
  10. LABEL maintainer="Hyperf Developers <group@hyperf.io>" version="1.0" license="MIT" app.name="Hyperf"
  11. ARG timezone
  12. ARG PHP_VERSION
  13. ENV TIMEZONE=${timezone:-"Asia/Shanghai"}
  14. ENV COMPOSER_ROOT_VERSION="v1.2.0"
  15. # update
  16. RUN set -ex \
  17. # show php version and extensions
  18. && php -v \
  19. && php -m \
  20. && php --ri swoole \
  21. # ---------- some config ----------
  22. && cd "/etc/php${PHP_VERSION%\.*}" \
  23. # - config PHP
  24. && { \
  25. echo "upload_max_filesize=128M"; \
  26. echo "post_max_size=128M"; \
  27. echo "memory_limit=1G"; \
  28. echo "date.timezone=${TIMEZONE}"; \
  29. } | tee conf.d/99_overrides.ini \
  30. # - config timezone
  31. && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
  32. && echo "${TIMEZONE}" > /etc/timezone \
  33. # ---------- clear works ----------
  34. && rm -rf /var/cache/apk/* /tmp/* /usr/share/man \
  35. && echo -e "\033[42;37m Build Completed :).\033[0m\n"
  36. WORKDIR /opt/www
  37. COPY . /opt/www
  38. RUN composer install -o