Skip to content

Commit

Permalink
php-worker fix
Browse files Browse the repository at this point in the history
  • Loading branch information
swallsky committed Aug 24, 2019
1 parent c90d6fb commit 85a071d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion php-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,29 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/' /etc/apk/repositories
&& apk add git \
&& apk add supervisor \
&& docker-php-ext-install mysqli pdo pdo_mysql

# Install the PHP gd zip pdo_mysql extention
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev \
&& docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
&& NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& docker-php-ext-install -j${NPROC} gd \
&& docker-php-ext-install pdo_mysql zip \
&& apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev

# 安装redis扩展
RUN curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/3.1.6.tar.gz \
&& tar xfz /tmp/redis.tar.gz \
&& rm -r /tmp/redis.tar.gz \
&& mkdir -p /usr/src/php/ext \
&& mv phpredis-3.1.6 /usr/src/php/ext/redis \
&& docker-php-ext-install redis \
# 如果这段不加构建的镜像将大100M,删除源代码文件
&& rm -rf /usr/src/php

# add a non-root user dockdev
RUN addgroup -g 1000 docker_env \
&& adduser -u 1000 -G docker_env -D -H dockdev
Expand Down Expand Up @@ -43,4 +66,4 @@ RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
#--------------------------------------------------------------------------
#

WORKDIR /etc/supervisor/conf.d/
WORKDIR /var/www/

0 comments on commit 85a071d

Please sign in to comment.