| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- FROM php:7.3-fpm-alpine
- WORKDIR "/app"
- #COPY ./sources.list /etc/apt/sources.list
- # 修改镜像源
- RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
- #RUN wget -P /tmp/ http://nginx.org/download/nginx-1.15.11.tar.gz
- #RUN cd /tmp/;tar xzf nginx-1.15.11.tar.gz;cd nginx-1.15.11;sed -i -e 's/1.15.11//g' -e 's/nginx\//WS/g' -e 's/"NGINX"/"WS"/g' src/core/nginx.h
- #RUN cd /tmp/nginx-1.15.11;./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module;make;make install
- # 安装依赖,核心扩展,pecl扩展,git,composer,npm工具
- RUN apk update && apk add --no-cache tzdata && apk add nginx && apk add --no-cache --virtual .build-deps \
- $PHPIZE_DEPS \
- curl-dev \
- libzip-dev \
- libtool \
- libxml2-dev \
- sqlite-dev \
- libmcrypt-dev \
- freetype-dev \
- libjpeg-turbo-dev \
- libpng-dev \
- && apk add --no-cache \
- curl \
- git \
- mysql-client \
- # 配置npm中国镜像
- && pecl install mcrypt-1.0.2 \
- && docker-php-ext-enable mcrypt \
- && docker-php-ext-install \
- bcmath \
- curl \
- mbstring \
- pdo \
- pdo_mysql \
- pcntl \
- tokenizer \
- xml \
- zip \
- && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
- && docker-php-ext-install -j"$(getconf _NPROCESSORS_ONLN)" gd \
- && pecl install -o -f redis \
- && rm -rf /tmp/pear \
- && docker-php-ext-enable redis
- # 安装composer并允许root用户运行
- ENV COMPOSER_ALLOW_SUPERUSER=1
- ENV COMPOSER_NO_INTERACTION=1
- ENV COMPOSER_HOME=/usr/local/share/composer
- RUN mkdir -p /usr/local/share/composer \
- && curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
- && php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot \
- && rm -f /tmp/composer-setup.* \
- # 配置composer中国全量镜像
- && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
- # Expose port 9000 and start php-fpm server
- #EXPOSE 9000
- ENV TZ=Asia/Shanghai
- RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
- COPY . /app
- COPY ./nginx/default.conf /etc/nginx/conf.d/
- COPY ./nginx/https.conf /etc/nginx/conf.d/
- COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
- COPY ./php-fpm/up.sh /usr/local/bin
- COPY ./php-fpm/php-ini-overrides.ini /usr/local/etc/php/conf.d/overrides.ini
- RUN mkdir -p /run/nginx
- RUN chmod a+x /usr/local/bin/up.sh
- RUN chmod a+x /app/www/new_sdk/crontab.sh
- RUN crontab ./crontabs/crontabfile.txt
- CMD ["/bin/sh", "/usr/local/bin/up.sh", "/app/www/new_sdk/crontab.sh"]
|