laravel-echo-server add change source

This commit is contained in:
Hao Yuqi 2020-07-25 16:29:55 +08:00
parent bb759d7b94
commit 7e513783e7
2 changed files with 10 additions and 0 deletions

View File

@ -1046,6 +1046,8 @@ services:
laravel-echo-server: laravel-echo-server:
build: build:
context: ./laravel-echo-server context: ./laravel-echo-server
args:
- CHANGE_SOURCE=${CHANGE_SOURCE}
volumes: volumes:
- ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro - ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro
ports: ports:

View File

@ -7,6 +7,14 @@ WORKDIR /usr/src/app
# Install app dependencies # Install app dependencies
COPY package.json /usr/src/app/ 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 \ RUN apk add --update \
python \ python \
python-dev \ python-dev \