diff --git a/docker-compose.yml b/docker-compose.yml index 5eb2cf0d..1bddaebd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,6 +59,7 @@ services: build: context: ./workspace args: + - CHANGE_SOURCE=${CHANGE_SOURCE} - LARADOCK_PHP_VERSION=${PHP_VERSION} - LARADOCK_PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_SUBVERSION=${WORKSPACE_INSTALL_SUBVERSION} @@ -272,6 +273,7 @@ services: build: context: ./laravel-horizon args: + - CHANGE_SOURCE=${CHANGE_SOURCE} - PHP_VERSION=${PHP_VERSION} - INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL} - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} @@ -295,9 +297,9 @@ services: build: context: ./nginx args: + - CHANGE_SOURCE=${CHANGE_SOURCE} - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER} - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT} - - CHANGE_SOURCE=${CHANGE_SOURCE} - http_proxy - https_proxy - no_proxy @@ -1636,4 +1638,4 @@ services: depends_on: - postgres volumes: - - ${DATA_PATH_HOST}/Confluence:/var/atlassian/application-data \ No newline at end of file + - ${DATA_PATH_HOST}/Confluence:/var/atlassian/application-data diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 425499d6..9edbe14b 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -9,6 +9,14 @@ FROM php:${PHP_VERSION}-alpine LABEL maintainer="Mahmoud Zalt " +# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. + +ARG CHANGE_SOURCE=false +RUN if [ ${CHANGE_SOURCE} = true ]; then \ + # Change application source from dl-cdn.alpinelinux.org to aliyun source + sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \ +;fi + RUN apk --update add wget \ curl \ git \ @@ -50,7 +58,7 @@ ARG INSTALL_CASSANDRA=false RUN if [ ${INSTALL_CASSANDRA} = true ]; then \ apk --update add cassandra-cpp-driver \ ;fi - + # Install PhpRedis package: ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index b51e9883..643cc664 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -23,10 +23,14 @@ ARG LARADOCK_PHP_VERSION # Set Environment Variables ENV DEBIAN_FRONTEND noninteractive +# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. + ARG CHANGE_SOURCE=false RUN if [ ${CHANGE_SOURCE} = true ]; then \ # Change application source from deb.debian.org to aliyun source - sed -i 's/deb.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \ + sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \ + sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \ + sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list \ ;fi # always run apt update when start and after add new source list, then clean up at end. @@ -270,10 +274,10 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ARG INSTALL_XHPROF=false RUN if [ ${INSTALL_XHPROF} = true ]; then \ - # Install the php xhprof extension + # Install the php xhprof extension if [ $(php -r "echo PHP_MAJOR_VERSION;") = 7 ]; then \ curl -L -o /tmp/xhprof.tar.gz "https://github.com/tideways/php-xhprof-extension/archive/v4.1.7.tar.gz"; \ - else \ + else \ curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \ fi \ && mkdir -p xhprof \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index cdeae231..02fe4bd3 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -23,6 +23,16 @@ ARG LARADOCK_PHP_VERSION # Set Environment Variables ENV DEBIAN_FRONTEND noninteractive +# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env. + +ARG CHANGE_SOURCE=false +RUN if [ ${CHANGE_SOURCE} = true ]; then \ + # Change application source from deb.debian.org to aliyun source + sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \ + sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \ + sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list \ +;fi + # Start as root USER root