加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Dockerfile 2.25 KB
一键复制 编辑 原始数据 按行查看 历史
西瓜哥666 提交于 2019-01-06 15:05 . fashop docker支持
FROM php:7.2
LABEL maintainer="fashop@fashop.com"
# Version
ENV PHPREDIS_VERSION 4.0.1
ENV HIREDIS_VERSION 0.13.3
ENV SWOOLE_VERSION 2.2.0
# Timezone
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo 'Asia/Shanghai' > /etc/timezone
# Libs
RUN apt-get update \
&& apt-get install -y \
libmagickwand-dev \
libmagickcore-dev \
curl \
wget \
git \
zip \
libz-dev \
libssl-dev \
libnghttp2-dev \
libpcre3-dev \
&& apt-get clean \
&& apt-get autoremove
# Composer
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& composer self-update --clean-backups
# imagick gd extension
RUN pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
# PDO extension
RUN docker-php-ext-install pdo_mysql
# Bcmath extension
RUN docker-php-ext-install bcmath
# Redis extension
RUN wget http://pecl.php.net/get/redis-${PHPREDIS_VERSION}.tgz -O /tmp/redis.tar.tgz \
&& pecl install /tmp/redis.tar.tgz \
&& rm -rf /tmp/redis.tar.tgz \
&& docker-php-ext-enable redis
# Hiredis
RUN wget https://github.com/redis/hiredis/archive/v${HIREDIS_VERSION}.tar.gz -O hiredis.tar.gz \
&& mkdir -p hiredis \
&& tar -xf hiredis.tar.gz -C hiredis --strip-components=1 \
&& rm hiredis.tar.gz \
&& ( \
cd hiredis \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
) \
&& rm -r hiredis
# Swoole extension
RUN wget https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& rm swoole.tar.gz \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-async-redis --enable-mysqlnd --enable-openssl --enable-http2 \
&& make -j$(nproc) \
&& make install \
) \
&& rm -r swoole \
&& docker-php-ext-enable swoole
ADD . /var/www/fashop
WORKDIR /var/www/fashop
# Install fashop
RUN composer install --no-dev \
&& composer dump-autoload -o \
&& composer clearcache
EXPOSE 9510
ENTRYPOINT ["php", "/var/www/fashop/fashop", "start"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化