-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (27 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
28 lines (27 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM php:8.0
RUN set -x \
&& apt-get update \
&& apt-get install -y unixodbc-dev zlib1g-dev libzip-dev zip \
# 创建`/usr/src/php/ext`目录
&& docker-php-source extract \
# 安装xdebug
&& pecl install xdebug-3.1.5 \
# 安装composer
&& curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/bin/composer && chmod +x /usr/bin/composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
# 安装扩展
&& docker-php-ext-install pdo_mysql \
zip \
pcntl \
&& docker-php-ext-enable xdebug \
# xdebug配置
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_handler=dbgp" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9111" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.idekey=PHPSTORM" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
# 删除`/usr/src/php/ext`目录
&& docker-php-source delete \
&& rm -rf /tmp/* \