Dockerfile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM php:8.2-fpm
  2. MAINTAINER xs
  3. ENV TZ="Asia/Shanghai"
  4. RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  5. # Utils
  6. RUN apt-get update && \
  7. apt-get install -y --no-install-recommends \
  8. libssl-dev libaio-dev net-tools dnsutils && \
  9. rm -rf /var/lib/apt/lists/*
  10. # Composer
  11. RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
  12. composer self-update --clean-backups && \
  13. composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
  14. # Core Libs
  15. RUN echo "Installing Core Libs..." && \
  16. # GD
  17. apt-get update && \
  18. apt-get install -y --no-install-recommends \
  19. libfreetype6-dev libjpeg62-turbo-dev libpng-dev && \
  20. rm -rf /var/lib/apt/lists/* && \
  21. docker-php-ext-configure gd --with-freetype --with-jpeg && \
  22. docker-php-ext-install -j$(nproc) gd && \
  23. # bcmath
  24. docker-php-ext-install bcmath && \
  25. # sockets
  26. docker-php-ext-install sockets && \
  27. # MySQL extension
  28. docker-php-ext-install mysqli pdo_mysql && \
  29. # Redis
  30. pecl install redis && \
  31. docker-php-ext-enable redis && \
  32. # ZIP
  33. apt-get update && \
  34. apt-get install -y --no-install-recommends \
  35. libzip-dev && \
  36. rm -rf /var/lib/apt/lists/* && \
  37. docker-php-ext-install -j$(nproc) zip
  38. # Expose port 9000
  39. EXPOSE 9000
  40. WORKDIR /