Dockerfile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
  6. # echo "deb http://mirrors.aliyu n.com/debian/ buster main non-free contrib" >/etc/apt/sources.list && \
  7. # echo "deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib" >>/etc/apt/sources.list && \
  8. # echo "deb http://mirrors.aliyun.com/debian-security buster/updates main" >>/etc/apt/sources.list && \
  9. # echo "deb-src http://mirrors.aliyun.com/debian-security buster/updates main" >>/etc/apt/sources.list && \
  10. # echo "deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib" >>/etc/apt/sources.list && \
  11. # echo "deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib" >>/etc/apt/sources.list && \
  12. # echo "deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib" >>/etc/apt/sources.list && \
  13. # echo "deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib" >>/etc/apt/sources.list
  14. # Utils
  15. RUN apt-get update && \
  16. apt-get install -y libssl-dev libaio-dev procps wget vim zip unzip git net-tools dnsutils && \
  17. apt-get clean
  18. # Composer
  19. RUN curl -sS https://getcomposer.org/installer | php && \
  20. mv composer.phar /usr/local/bin/composer && \
  21. composer self-update --clean-backups && \
  22. composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
  23. # Core Libs
  24. RUN echo "Installing Core Libs..." && \
  25. #gd
  26. apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && \
  27. docker-php-ext-configure gd --with-freetype --with-jpeg && \
  28. docker-php-ext-install -j$(nproc) gd && \
  29. # bcmath
  30. docker-php-ext-install bcmath && \
  31. # sockets
  32. docker-php-ext-install sockets && \
  33. # MySQL extension
  34. docker-php-ext-install mysqli && \
  35. docker-php-ext-install pdo_mysql && \
  36. # Redis
  37. pecl install redis && \
  38. docker-php-ext-enable redis && \
  39. # swoole
  40. pecl install swoole && \
  41. docker-php-ext-enable swoole
  42. # ZIP
  43. RUN apt-get install -y libzip-dev && \
  44. docker-php-ext-install -j$(nproc) zip
  45. ## Crontab
  46. RUN apt-get install -y cron
  47. # Expose port 9000
  48. EXPOSE 9000
  49. WORKDIR /