2 Star 4 Fork 1

PHP游戏开发实践/swoft-ddz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 3.23 KB
一键复制 编辑 原始数据 按行查看 历史
jxy918 提交于 2019-10-30 10:25 . load code
# @description php image base on the debian 9.x
#
# Some Information
# ------------------------------------------------------------------------------------
# @link https://hub.docker.com/_/debian/ alpine image
# @link https://hub.docker.com/_/php/ php image
# @link https://github.com/docker-library/php php dockerfiles
# @see https://github.com/docker-library/php/tree/master/7.2/stretch/cli/Dockerfile
# ------------------------------------------------------------------------------------
# @build-example docker build . -f Dockerfile -t swoft/swoft
#
FROM php:7.2
LABEL maintainer="jxy918 <251413215@qq.com>" version="2.1"
# --build-arg timezone=Asia/Shanghai
ARG timezone
# app env: prod pre test dev
ARG app_env=prod
# default use www-data user
ARG work_user=www-data
ENV APP_ENV=${app_env:-"prod"} \
TIMEZONE=${timezone:-"Asia/Shanghai"} \
PHPREDIS_VERSION=4.3.0 \
SWOOLE_VERSION=4.4.3 \
COMPOSER_ALLOW_SUPERUSER=1
# Libs -y --no-install-recommends
RUN apt-get update \
&& apt-get install -y \
curl wget git zip unzip less vim openssl \
libz-dev \
libssl-dev \
libnghttp2-dev \
libpcre3-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
# Install composer
&& curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& composer self-update --clean-backups \
# Install PHP extensions
&& docker-php-ext-install \
bcmath gd pdo_mysql mbstring sockets zip sysvmsg sysvsem sysvshm \
# Install redis extension
&& 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 \
# Install swoole extension
&& 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-mysqlnd --enable-sockets --enable-openssl --enable-http2 \
&& make -j$(nproc) \
&& make install \
) \
&& rm -r swoole \
&& docker-php-ext-enable swoole \
#Install msgpack extension
&& wget http://pecl.php.net/get/msgpack-2.0.3.tgz -O msgpack-2.0.3.tgz \
&& mkdir -p msgpack \
&& tar -xf msgpack-2.0.3.tgz -C msgpack --strip-components=1 \
&& ( \
cd msgpack \
&& phpize \
&& ./configure \
&& make \
&& make install \
) \
&& rm -r msgpack \
&& docker-php-ext-enable msgpack \
# Clear dev deps
&& apt-get clean \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
# Timezone
&& cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone \
&& echo "[Date]\ndate.timezone=${TIMEZONE}" > /usr/local/etc/php/conf.d/timezone.ini
# Install composer deps
#ADD . /var/www/swoft
#RUN cd /var/www/swoft \
# && composer install \
# && composer clearcache
#
WORKDIR /var/www/swoft
EXPOSE 18306 18307 18308
# ENTRYPOINT ["php", "/var/www/swoft/bin/swoft", "http:start"]
# CMD ["php", "/var/www/swoft/bin/swoft", "http:start"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/jxy918/swoft-ddz.git
git@gitee.com:jxy918/swoft-ddz.git
jxy918
swoft-ddz
swoft-ddz
master

搜索帮助