Skip to content

Commit 73090c8

Browse files
committed
chore: Add pip, uv and npm source configed from envs
1 parent bbd69b2 commit 73090c8

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/docker-publish-allinone.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ jobs:
7373
platforms: linux/amd64,linux/arm64
7474
cache-from: type=gha
7575
cache-to: type=gha,mode=max
76+
build-args: |
77+
PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
78+
UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/
79+
npm_config_registry=https://registry.npmmirror.com
7680
tags: |
7781
${{ env.PUSH_LATEST == 'true' && format('{0}/mcp-gateway-allinone:latest', env.DOCKER_HUB_USERNAME) || '' }}
7882
${{ format('{0}/mcp-gateway-allinone:{1}', env.DOCKER_HUB_USERNAME, github.ref_name) }}

deploy/docker/allinone/Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,18 @@ RUN npm run build
4242

4343
FROM ubuntu:22.04
4444

45-
# Set default timezone
4645
ENV TZ=UTC
4746
ENV DEBIAN_FRONTEND=noninteractive
4847

48+
# Define ARGs for package sources
49+
ARG PIP_INDEX_URL=https://pypi.org/simple
50+
ARG UV_DEFAULT_INDEX=https://pypi.org/simple
51+
ARG npm_config_registry=https://registry.npmjs.org/
52+
53+
ENV PIP_INDEX_URL=${PIP_INDEX_URL} \
54+
UV_DEFAULT_INDEX=${UV_DEFAULT_INDEX} \
55+
npm_config_registry=${npm_config_registry}
56+
4957
# Install essential packages and setup timezone
5058
RUN apt-get update && apt-get install -y \
5159
supervisor \
@@ -76,6 +84,11 @@ RUN python3 -m pip install pipx && \
7684
# Install uv
7785
RUN python3 -m pip install uv
7886

87+
# Configure pip and npm to use the specified repositories
88+
RUN mkdir -p /root/.config/pip && \
89+
echo -e "[global]\nindex-url = ${PIP_INDEX_URL}" > /root/.config/pip/pip.conf && \
90+
npm config set registry ${npm_config_registry} -g
91+
7992
COPY deploy/docker/allinone/supervisord.conf /etc/supervisor/conf.d/
8093
COPY deploy/docker/allinone/nginx.conf /etc/nginx/nginx.conf
8194
RUN mkdir -p /app/data

0 commit comments

Comments
 (0)