fix: reducir prioridad de CPU/IO en builds Docker con nice+ionice

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-25 08:12:57 -05:00
co-authored by Claude Sonnet 4.6
parent d95e82034a
commit c3739ae581
+3 -2
View File
@@ -14,14 +14,15 @@ RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o apiv2 .
RUN nice -n 19 ionice -c 3 sh -c 'CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o apiv2 .'
# Compilar agente para múltiples plataformas
RUN cd agent && go mod download && \
mkdir -p /app/agent/dist && \
nice -n 19 ionice -c 3 sh -c '\
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /app/agent/dist/usite-agent-linux-amd64 . && \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o /app/agent/dist/usite-agent-linux-arm64 . && \
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags="-s -w" -o /app/agent/dist/usite-agent-linux-arm .
CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags="-s -w" -o /app/agent/dist/usite-agent-linux-arm .'
# ──────────────────────────────────────────
# Stage 3: Imagen final mínima