Skip to content

Commit

Permalink
feat:镜像加速
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdeer committed Jan 5, 2024
1 parent 994ae9c commit 9e3af71
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1
# If you need to change the sources (i.e. to China), set CHANGE_SOURCE to true
CHANGE_SOURCE=true
# Set ORACLE INSTANT_CLIENT_MIRROR option if you want to use Intranet improve download, you can download files first
ORACLE_INSTANT_CLIENT_MIRROR=https://raw.githubusercontents.com/diogomascarenha/oracle-instantclient/master/
ORACLE_INSTANT_CLIENT_MIRROR=https://raw.gitmirror.com/diogomascarenha/oracle-instantclient/master/
ORACLE_INSTANT_CLIENT_ARCH=x86_64
ORACLE_INSTANT_CLIENT_MAJOR=18
ORACLE_INSTANT_CLIENT_MINOR=3
Expand Down Expand Up @@ -110,7 +110,7 @@ WORKSPACE_COMPOSER_REPO_PACKAGIST=https://mirrors.aliyun.com/composer/
WORKSPACE_NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
WORKSPACE_INSTALL_NODE=true
WORKSPACE_NODE_VERSION=node
WORKSPACE_NPM_REGISTRY==https://registry.npm.taobao.org
WORKSPACE_NPM_REGISTRY=https://registry.npm.taobao.org
WORKSPACE_NPM_FETCH_RETRIES=2
WORKSPACE_NPM_FETCH_RETRY_FACTOR=10
WORKSPACE_NPM_FETCH_RETRY_MINTIMEOUT=10000
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ services:
- docker-in-docker:/certs/client
ports:
- "9073:9003"
- "8003:8003"
- "8004:8004"
- "8101:8101"
expose:
- "9000"
extra_hosts:
Expand Down
19 changes: 11 additions & 8 deletions workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ USER root
ARG INSTALL_WP_CLI=false

RUN if [ ${INSTALL_WP_CLI} = true ]; then \
curl -fsSL -o /usr/local/bin/wp https://raw.githubusercontents.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | bash && \
curl -fsSL -o /usr/local/bin/wp https://raw.gitmirror.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | bash && \
chmod +x /usr/local/bin/wp \
;fi

Expand Down Expand Up @@ -736,9 +736,9 @@ ENV NVM_NODEJS_ORG_MIRROR ${NVM_NODEJS_ORG_MIRROR}
USER root

RUN apt-get install wget && \
wget -P /home/laradock/ https://raw.githubusercontents.com/nvm-sh/nvm/v0.39.2/install.sh && \
sed -i 's/raw.githubusercontent.com/raw.githubusercontents.com/' /home/laradock/install.sh && \
sed -i 's/github.com/gitclone.com\/github.com/' /home/laradock/install.sh && \
wget -P /home/laradock/ https://raw.gitmirror.com/nvm-sh/nvm/v0.39.2/install.sh && \
sed -i 's/raw.githubusercontent.com/raw.gitmirror.com/' /home/laradock/install.sh && \
sed -i 's/github.com/githubfast.com/' /home/laradock/install.sh && \
cat /home/laradock/install.sh && \
chown laradock:laradock /home/laradock/install.sh

Expand Down Expand Up @@ -844,10 +844,13 @@ ENV YARN_VERSION ${YARN_VERSION}
RUN if [ ${INSTALL_YARN} = true ]; then \
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
if [ ${YARN_VERSION} = "latest" ]; then \
curl -o- -L https://yarnpkg.com/install.sh | bash; \
wget -P /home/laradock/yarn/ https://classic.yarnpkg.com/install.sh | bash; \
else \
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
wget -P /home/laradock/yarn/ https://classic.yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
fi && \
sed -i 's/yarnpkg.com/classic.yarnpkg.com/' /home/laradock/yarn/install.sh && \
cat /home/laradock/yarn/install.sh && \
chown laradock:laradock /home/laradock/yarn/install.sh && \
echo "" >> ~/.bashrc && \
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
;fi
Expand Down Expand Up @@ -1576,7 +1579,7 @@ ARG SHELL_OH_MY_ZSH_ALIASES=false

USER laradock
RUN if [ ${SHELL_OH_MY_ZSH} = true ]; then \
sh -c "$(curl -fsSL https://raw.githubusercontents.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --keep-zshrc" && \
sh -c "$(curl -fsSL https://raw.gitmirror.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --keep-zshrc" && \
sed -i -r 's/^plugins=\(.*?\)$/plugins=(laravel5)/' /home/laradock/.zshrc && \
echo '\n\
bindkey "^[OB" down-line-or-search\n\
Expand Down Expand Up @@ -1807,7 +1810,7 @@ USER root

# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm -rf /var/lib/apt/lists/* /var/tmp/* && \
rm /var/log/lastlog /var/log/faillog

# Set default work directory
Expand Down

0 comments on commit 9e3af71

Please sign in to comment.