fix: Dockerfile auto-suffisant — clone viewLogs/viewServices depuis Forgejo
Supprime la dépendance au contexte parent (context: ..). Le Dockerfile clone viewLogs et viewServices depuis git pendant le build, dans /workspace/ pour correspondre aux replace directives go.mod (../../). docker-compose.yml revient à context: ./backend — fonctionne quelle que soit la structure de répertoires sur le serveur. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cbf87a87fc
commit
4b1a0a09a8
2 changed files with 15 additions and 11 deletions
|
|
@ -1,19 +1,23 @@
|
|||
# ── Étape 1 : Build du binaire Go ──────────────────────────────────────────
|
||||
# Build context = proxmoxPanel/ (parent de core/)
|
||||
# Build context = core/backend/ (pas besoin du répertoire parent)
|
||||
# Les modules viewLogs et viewServices sont clonés depuis Forgejo pendant le build.
|
||||
FROM golang:1.26-alpine AS builder
|
||||
|
||||
# Dépendances de compilation (git pour les modules Go)
|
||||
RUN apk add --no-cache git
|
||||
RUN apk add --no-cache git ca-certificates
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Copier les sources des trois modules
|
||||
COPY core/backend/ ./core/backend/
|
||||
COPY viewLogs/ ./viewLogs/
|
||||
COPY viewServices/ ./viewServices/
|
||||
# Cloner les modules dans la même arborescence que les replace directives go.mod
|
||||
# go.mod: replace ../../viewLogs → depuis /workspace/core/backend/ = /workspace/viewLogs ✓
|
||||
RUN git clone https://git.geronzi.fr/proxmoxPanel/viewLogs /workspace/viewLogs
|
||||
RUN git clone https://git.geronzi.fr/proxmoxPanel/viewServices /workspace/viewServices
|
||||
|
||||
WORKDIR /workspace/core/backend
|
||||
|
||||
# Copier les fichiers de dépendances (optimise le cache Docker)
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Copier tout le code source du CORE
|
||||
COPY . .
|
||||
|
||||
# Télécharger les dépendances
|
||||
RUN go mod download
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue