Make GOPROXY a build arg (proxy.golang.org is blocked on some networks)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,11 @@ ARG VERSION=dev
|
|||||||
RUN TEFTER_VERSION=$VERSION npx vite build
|
RUN TEFTER_VERSION=$VERSION npx vite build
|
||||||
|
|
||||||
FROM docker.io/library/golang:1.25-alpine AS build
|
FROM docker.io/library/golang:1.25-alpine AS build
|
||||||
|
# Overridable for hosts where proxy.golang.org (Google) is unreachable —
|
||||||
|
# set e.g. GOPROXY=https://goproxy.io,direct in .env.docker. Module
|
||||||
|
# integrity is still verified against the committed go.sum either way.
|
||||||
|
ARG GOPROXY=https://proxy.golang.org,direct
|
||||||
|
ENV GOPROXY=$GOPROXY
|
||||||
WORKDIR /src/server
|
WORKDIR /src/server
|
||||||
COPY server/go.mod server/go.sum ./
|
COPY server/go.mod server/go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ SERVICE=tefter.service
|
|||||||
|
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
|
|
||||||
# Port the app is published on (kept in .env.docker next to the compose file).
|
# Host-specific settings (WEB_PORT, GOPROXY, ...) live in .env.docker next to
|
||||||
WEB_PORT=$(grep -oP '^WEB_PORT=\K.*' .env.docker 2>/dev/null || echo 8420)
|
# the compose file; export them so compose interpolation sees them.
|
||||||
|
set -a; [ -f .env.docker ] && . ./.env.docker; set +a
|
||||||
|
WEB_PORT=${WEB_PORT:-8420}
|
||||||
|
|
||||||
echo "==> Pulling latest code..."
|
echo "==> Pulling latest code..."
|
||||||
git pull
|
git pull
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
VERSION: ${TEFTER_VERSION:-dev}
|
VERSION: ${TEFTER_VERSION:-dev}
|
||||||
|
GOPROXY: ${GOPROXY:-https://proxy.golang.org,direct}
|
||||||
environment:
|
environment:
|
||||||
TEFTER_DB: /data/tefter.db
|
TEFTER_DB: /data/tefter.db
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user