diff --git a/.gitea/workflows/gateway-build.yml b/.gitea/workflows/gateway-build.yml index ba79f28..d16f480 100644 --- a/.gitea/workflows/gateway-build.yml +++ b/.gitea/workflows/gateway-build.yml @@ -10,7 +10,7 @@ env: jobs: build-and-deploy: - runs-on: lxc-111 + runs-on: lxc-107 steps: - name: Clone repository env: @@ -29,9 +29,21 @@ jobs: cd repo REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed 's|https\?://||') IMAGE="${REGISTRY_HOST}/${{ gitea.repository }}/gateway" + BUILD_PROXY="${BUILD_PROXY:-http://192.168.50.111:8080}" + BUILD_NO_PROXY="${BUILD_NO_PROXY:-localhost,127.0.0.1,192.168.50.0/24,192.168.50.109:3000}" echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY_HOST" -u "${{ gitea.actor }}" --password-stdin - docker build -t "${IMAGE}:latest" -t "${IMAGE}:${{ gitea.sha }}" . + docker build \ + --network host \ + --build-arg HTTP_PROXY="${BUILD_PROXY}" \ + --build-arg HTTPS_PROXY="${BUILD_PROXY}" \ + --build-arg NO_PROXY="${BUILD_NO_PROXY}" \ + --build-arg http_proxy="${BUILD_PROXY}" \ + --build-arg https_proxy="${BUILD_PROXY}" \ + --build-arg no_proxy="${BUILD_NO_PROXY}" \ + -t "${IMAGE}:latest" \ + -t "${IMAGE}:${{ gitea.sha }}" \ + . docker push "${IMAGE}:latest" docker push "${IMAGE}:${{ gitea.sha }}" diff --git a/Dockerfile b/Dockerfile index 6abe72a..5360329 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,10 @@ FROM node:22-bookworm-slim AS ui-build +ARG HTTP_PROXY +ARG HTTPS_PROXY +ARG NO_PROXY +ARG http_proxy +ARG https_proxy +ARG no_proxy WORKDIR /app COPY package.json ./ RUN npm install @@ -8,6 +14,12 @@ RUN npm run build FROM debian:bookworm-slim ARG SINGBOX_VERSION=1.12.13 +ARG HTTP_PROXY +ARG HTTPS_PROXY +ARG NO_PROXY +ARG http_proxy +ARG https_proxy +ARG no_proxy RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl iptables iproute2 nodejs dumb-init \