fix: refactoring

This commit is contained in:
charlesgauthereau
2026-02-10 19:11:01 +01:00
parent eff7b24b7a
commit 5dfe1b758e
9 changed files with 0 additions and 301 deletions
-28
View File
@@ -17,35 +17,11 @@ RUN apt-get update && apt-get install -y \
nginx \
&& rm -rf /var/lib/apt/lists/*
#FROM base AS tusd-base
#
#ENV TUSD_VERSION=2.8.0
#
#RUN apt-get update && apt-get install -y \
# curl \
# ca-certificates \
# bash \
# tar \
# gzip \
# libssl-dev \
# && rm -rf /var/lib/apt/lists/*
#
## Download and extract tusd
#RUN curl -L -o /tmp/tusd.tar.gz \
# https://github.com/tus/tusd/releases/download/v${TUSD_VERSION}/tusd_linux_amd64.tar.gz \
# && mkdir -p /usr/local/bin \
# && tar -xzf /tmp/tusd.tar.gz -C /tmp \
# # Move the actual binary, whatever its name/folder inside tar
# && mv /tmp/*/tusd /usr/local/bin/tusd \
# && chmod +x /usr/local/bin/tusd \
# && /usr/local/bin/tusd --version
# Use Debian-based Go for reliable networking/DNS during build
FROM --platform=$BUILDPLATFORM golang:1.23-bookworm AS tusd-base
ARG TUSD_VERSION=2.8.0
# Install git
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
@@ -54,16 +30,13 @@ WORKDIR /build
RUN git clone https://github.com/tus/tusd.git . \
&& git checkout v${TUSD_VERSION}
# Build statically linked binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
go build -ldflags="-s -w" -o /tusddist/tusd ./cmd/tusd
# Minimal dist stage (scratch keeps final image small)
FROM scratch AS tusd-dist
COPY --from=tusd-base /tusddist/tusd /tusd
FROM base AS build-env
RUN corepack enable && corepack prepare pnpm@latest --activate
@@ -116,7 +89,6 @@ COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static
COPY --chown=1001:1001 src/db ./src/db
COPY --from=deps /app/node_modules ./node_modules
#COPY --from=tusd-base /usr/local/bin/tusd /usr/local/bin/tusd
COPY --from=tusd-dist /tusd /usr/local/bin/tusd
RUN chmod +x /usr/local/bin/tusd