From 51d821b35f527edd4c618b646a31c23a5b8bd942 Mon Sep 17 00:00:00 2001 From: zill057 Date: Mon, 28 Oct 2019 17:15:31 +0800 Subject: [PATCH] Add CHANGE_SOURCE option for php-worker --- docker-compose.yml | 1 + php-worker/Dockerfile | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 896adb59..ee00bd25 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -222,6 +222,7 @@ services: build: context: ./php-worker args: + - CHANGE_SOURCE=${CHANGE_SOURCE} - PHP_VERSION=${PHP_VERSION} - PHALCON_VERSION=${PHALCON_VERSION} - INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL} diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 9bccca0e..350c40dc 100644 --- a/php-worker/Dockerfile +++ b/php-worker/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 \