mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 10:42:57 +00:00
fix
This commit is contained in:
+4
-3
@@ -1,5 +1,6 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM golang:1.24.5-bullseye AS builder
|
ARG GO_IMAGE_TAG=1.25.8-bookworm
|
||||||
|
FROM golang:${GO_IMAGE_TAG} AS builder
|
||||||
ARG REMBG_ENABLED=true
|
ARG REMBG_ENABLED=true
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -21,7 +22,7 @@ COPY . .
|
|||||||
# Install Python dependencies for rembg
|
# Install Python dependencies for rembg
|
||||||
COPY scripts/requirements-rembg.txt .
|
COPY scripts/requirements-rembg.txt .
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install -r requirements-rembg.txt; else echo "REMBG disabled, skipping pip install"; fi
|
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install --break-system-packages -r requirements-rembg.txt; else echo "REMBG disabled, skipping pip install"; fi
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o fotbal-club
|
RUN CGO_ENABLED=0 GOOS=linux go build -o fotbal-club
|
||||||
@@ -47,7 +48,7 @@ RUN addgroup --system app && adduser --system --ingroup app app \
|
|||||||
# Install rembg and its dependencies
|
# Install rembg and its dependencies
|
||||||
COPY --from=builder /app/requirements-rembg.txt .
|
COPY --from=builder /app/requirements-rembg.txt .
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install -r requirements-rembg.txt; fi \
|
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install --break-system-packages -r requirements-rembg.txt; fi \
|
||||||
&& rm -f requirements-rembg.txt
|
&& rm -f requirements-rembg.txt
|
||||||
|
|
||||||
# Copy the binary from builder
|
# Copy the binary from builder
|
||||||
|
|||||||
+4
-3
@@ -1,5 +1,6 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM golang:1.24.5-bullseye AS builder
|
ARG GO_IMAGE_TAG=1.25.8-bookworm
|
||||||
|
FROM golang:${GO_IMAGE_TAG} AS builder
|
||||||
ARG REMBG_ENABLED=true
|
ARG REMBG_ENABLED=true
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -33,7 +34,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
|||||||
# Install Python dependencies for rembg (before copying full source for better cacheability)
|
# Install Python dependencies for rembg (before copying full source for better cacheability)
|
||||||
COPY scripts/requirements-rembg.txt .
|
COPY scripts/requirements-rembg.txt .
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install -r requirements-rembg.txt; else echo "REMBG disabled, skipping pip install"; fi
|
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install --break-system-packages -r requirements-rembg.txt; else echo "REMBG disabled, skipping pip install"; fi
|
||||||
|
|
||||||
# Copy the source code
|
# Copy the source code
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -67,7 +68,7 @@ RUN addgroup --system app && adduser --system --ingroup app app \
|
|||||||
# Install rembg and its dependencies
|
# Install rembg and its dependencies
|
||||||
COPY --from=builder /app/requirements-rembg.txt .
|
COPY --from=builder /app/requirements-rembg.txt .
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install -r requirements-rembg.txt; fi \
|
if [ "$REMBG_ENABLED" = "true" ]; then pip3 install --break-system-packages -r requirements-rembg.txt; fi \
|
||||||
&& rm -f requirements-rembg.txt
|
&& rm -f requirements-rembg.txt
|
||||||
|
|
||||||
# Copy the binary and other files
|
# Copy the binary and other files
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
# Separate lightweight Go build, sharing the same module and internal packages as the main backend.
|
# Separate lightweight Go build, sharing the same module and internal packages as the main backend.
|
||||||
|
|
||||||
# Build stage
|
# Build stage
|
||||||
FROM golang:1.24.5-bullseye AS builder
|
ARG GO_IMAGE_TAG=1.25.8-bookworm
|
||||||
|
FROM golang:${GO_IMAGE_TAG} AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user