Skip to content

Commit 51d821b

Browse files
author
zill057
committed
Add CHANGE_SOURCE option for php-worker
1 parent c09261e commit 51d821b

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
@@ -222,6 +222,7 @@ services:
222222
build:
223223
context: ./php-worker
224224
args:
225+
- CHANGE_SOURCE=${CHANGE_SOURCE}
225226
- PHP_VERSION=${PHP_VERSION}
226227
- PHALCON_VERSION=${PHALCON_VERSION}
227228
- 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)