Skip to content

Commit f64adc2

Browse files
author
mouyong
committed
workspace and php-fpm change source
1 parent da8f0d0 commit f64adc2

9 files changed

Lines changed: 68 additions & 5 deletions

File tree

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ services:
5555
build:
5656
context: ./workspace
5757
args:
58+
- CHANGE_SOURCE=${CHANGE_SOURCE}
5859
- LARADOCK_PHP_VERSION=${PHP_VERSION}
5960
- LARADOCK_PHALCON_VERSION=${PHALCON_VERSION}
6061
- INSTALL_SUBVERSION=${WORKSPACE_INSTALL_SUBVERSION}
@@ -126,6 +127,7 @@ services:
126127
- no_proxy
127128
volumes:
128129
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
130+
- "./workspace/crontab/laradock:/etc/cron.d/laradock"
129131
extra_hosts:
130132
- "dockerhost:${DOCKER_HOST_IP}"
131133
ports:
@@ -145,6 +147,7 @@ services:
145147
build:
146148
context: ./php-fpm
147149
args:
150+
- CHANGE_SOURCE=${CHANGE_SOURCE}
148151
- LARADOCK_PHP_VERSION=${PHP_VERSION}
149152
- LARADOCK_PHALCON_VERSION=${PHALCON_VERSION}
150153
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}
@@ -200,6 +203,7 @@ services:
200203
- "9000"
201204
extra_hosts:
202205
- "dockerhost:${DOCKER_HOST_IP}"
206+
dns: 114.114.114.114
203207
environment:
204208
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
205209
- DOCKER_HOST=tcp://docker-in-docker:2375
@@ -211,6 +215,7 @@ services:
211215
links:
212216
- docker-in-docker
213217

218+
214219
### PHP Worker ############################################
215220
php-worker:
216221
build:

mysql/my.cnf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
[mysql]
77

88
[mysqld]
9-
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
9+
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
1010
character-set-server=utf8mb4
11+
skip-name-resolve
12+
symbolic-links=0
13+
explicit_defaults_for_timestamp
14+
default_authentication_plugin=mysql_native_password
15+
#skip-grant-tables=1
16+

php-fpm/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ ARG LARADOCK_PHP_VERSION
2424
# Set Environment Variables
2525
ENV DEBIAN_FRONTEND noninteractive
2626

27+
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
28+
29+
ADD debian.sources.list /etc/apt/debian.sources.list
30+
ARG CHANGE_SOURCE=false
31+
RUN if [ ${CHANGE_SOURCE} = true ]; then \
32+
mv /etc/apt/sources.list /etc/apt/sources.list.back && \
33+
mv /etc/apt/debian.sources.list /etc/apt/sources.list \
34+
;fi
35+
36+
2737
# always run apt update when start and after add new source list, then clean up at end.
2838
RUN set -xe; \
2939
apt-get update -yqq && \

php-fpm/debian.sources.list

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
2+
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
3+
deb http://mirrors.aliyun.com/debian-security stretch/updates main
4+
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
5+
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
6+
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
7+
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
8+
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib

php-fpm/xdebug.ini

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ xdebug.remote_connect_back=1
55
xdebug.remote_port=9000
66
xdebug.idekey=PHPSTORM
77

8-
xdebug.remote_autostart=0
8+
xdebug.remote_autostart=1
99
xdebug.remote_enable=0
10-
xdebug.cli_color=0
10+
xdebug.cli_color=1
1111
xdebug.profiler_enable=0
1212
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
1313

1414
xdebug.remote_handler=dbgp
1515
xdebug.remote_mode=req
16+
xdebug.remote_log=/var/log/php/xdebug_remote.log
17+
18+
xdebug.auto_trace = 1
19+
xdebug.collect_params = 1
20+
xdebug.collect_return = 1
1621

1722
xdebug.var_display_max_children=-1
1823
xdebug.var_display_max_data=-1

workspace/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ ARG LARADOCK_PHP_VERSION
2424
# Set Environment Variables
2525
ENV DEBIAN_FRONTEND noninteractive
2626

27+
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
28+
29+
ADD ubuntu.sources.list /etc/apt/ubuntu.sources.list
30+
ARG CHANGE_SOURCE=false
31+
RUN if [ ${CHANGE_SOURCE} = true ]; then \
32+
mv /etc/apt/sources.list /etc/apt/sources.list.back && \
33+
mv /etc/apt/ubuntu.sources.list /etc/apt/sources.list \
34+
;fi
35+
2736
# Start as root
2837
USER root
2938

workspace/ubuntu.sources.list

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
deb http://mirrors.aliyun.com/ubuntu/ xenial main
2+
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
3+
4+
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
5+
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
6+
7+
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
8+
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
9+
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
10+
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
11+
12+
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
13+
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
14+
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
15+
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe

workspace/xdebug.ini

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ xdebug.remote_connect_back=1
55
xdebug.remote_port=9000
66
xdebug.idekey=PHPSTORM
77

8-
xdebug.remote_autostart=0
8+
xdebug.remote_autostart=1
99
xdebug.remote_enable=0
10-
xdebug.cli_color=0
10+
xdebug.cli_color=1
1111
xdebug.profiler_enable=0
1212
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
1313

1414
xdebug.remote_handler=dbgp
1515
xdebug.remote_mode=req
16+
xdebug.remote_log=/var/log/php/xdebug_remote.log
17+
18+
xdebug.auto_trace = 1
19+
xdebug.collect_params = 1
20+
xdebug.collect_return = 1
1621

1722
xdebug.var_display_max_children=-1
1823
xdebug.var_display_max_data=-1

0 commit comments

Comments
 (0)