Skip to content

Commit a7faceb

Browse files
authored
Merge pull request laradock#2343 from zill057/master
Add CHANGE_SOURCE option for php-worker
2 parents f27c186 + 51d821b commit a7faceb

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ services:
232232
build:
233233
context: ./php-worker
234234
args:
235+
- CHANGE_SOURCE=${CHANGE_SOURCE}
235236
- PHP_VERSION=${PHP_VERSION}
236237
- PHALCON_VERSION=${PHALCON_VERSION}
237238
- INSTALL_PGSQL=${PHP_WORKER_INSTALL_PGSQL}

php-worker/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ FROM php:${PHP_VERSION}-alpine
99

1010
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
1111

12+
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
13+
14+
ARG CHANGE_SOURCE=false
15+
RUN if [ ${CHANGE_SOURCE} = true ]; then \
16+
# Change application source from dl-cdn.alpinelinux.org to aliyun source
17+
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \
18+
;fi
19+
1220
RUN apk --update add wget \
1321
curl \
1422
git \

0 commit comments

Comments
 (0)