From 7e513783e7545632855a224b8ce1208814134a68 Mon Sep 17 00:00:00 2001 From: Hao Yuqi Date: Sat, 25 Jul 2020 16:29:55 +0800 Subject: [PATCH] laravel-echo-server add change source --- docker-compose.yml | 2 ++ laravel-echo-server/Dockerfile | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4dd89df9..5221f87c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1046,6 +1046,8 @@ services: laravel-echo-server: build: context: ./laravel-echo-server + args: + - CHANGE_SOURCE=${CHANGE_SOURCE} volumes: - ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro ports: diff --git a/laravel-echo-server/Dockerfile b/laravel-echo-server/Dockerfile index da6b2561..26a64c1a 100644 --- a/laravel-echo-server/Dockerfile +++ b/laravel-echo-server/Dockerfile @@ -7,6 +7,14 @@ WORKDIR /usr/src/app # Install app dependencies COPY package.json /usr/src/app/ +# 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 add --update \ python \ python-dev \