revert: supprimer les dépendances externes viewLogs/viewServices du CORE
Le CORE est autonome — les modules externes ne doivent pas être des dépendances Go compilées dans le binaire. Retour au Dockerfile et docker-compose.yml originaux (context: ./backend). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4b1a0a09a8
commit
dcf3b937fa
4 changed files with 8 additions and 26 deletions
|
|
@ -1,26 +1,18 @@
|
||||||
# ── Étape 1 : Build du binaire Go ──────────────────────────────────────────
|
# ── Étape 1 : Build du binaire Go ──────────────────────────────────────────
|
||||||
# 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
|
FROM golang:1.26-alpine AS builder
|
||||||
|
|
||||||
RUN apk add --no-cache git ca-certificates
|
# Dépendances de compilation (git pour les modules Go)
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
# Cloner les modules dans la même arborescence que les replace directives go.mod
|
WORKDIR /build
|
||||||
# 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 en premier (optimise le cache Docker)
|
||||||
|
|
||||||
# Copier les fichiers de dépendances (optimise le cache Docker)
|
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
|
|
||||||
# Copier tout le code source du CORE
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Télécharger les dépendances
|
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
|
# Copier tout le code source
|
||||||
|
COPY . .
|
||||||
|
|
||||||
# Compiler le binaire de façon statique
|
# Compiler le binaire de façon statique
|
||||||
# -ldflags="-s -w" : supprime les infos de debug pour réduire la taille
|
# -ldflags="-s -w" : supprime les infos de debug pour réduire la taille
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ module git.geronzi.fr/proxmoxPanel/core/backend
|
||||||
go 1.26.1
|
go 1.26.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.geronzi.fr/proxmoxPanel/viewLogs v0.0.0
|
|
||||||
git.geronzi.fr/proxmoxPanel/viewServices v0.0.0
|
|
||||||
github.com/go-chi/chi/v5 v5.2.5
|
github.com/go-chi/chi/v5 v5.2.5
|
||||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||||
github.com/gorilla/websocket v1.5.3
|
github.com/gorilla/websocket v1.5.3
|
||||||
|
|
@ -12,11 +10,6 @@ require (
|
||||||
modernc.org/sqlite v1.47.0
|
modernc.org/sqlite v1.47.0
|
||||||
)
|
)
|
||||||
|
|
||||||
replace (
|
|
||||||
git.geronzi.fr/proxmoxPanel/viewLogs => ../../viewLogs
|
|
||||||
git.geronzi.fr/proxmoxPanel/viewServices => ../../viewServices
|
|
||||||
)
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/google/uuid v1.6.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ import (
|
||||||
sshpool "git.geronzi.fr/proxmoxPanel/core/backend/internal/ssh"
|
sshpool "git.geronzi.fr/proxmoxPanel/core/backend/internal/ssh"
|
||||||
"git.geronzi.fr/proxmoxPanel/core/backend/internal/websocket"
|
"git.geronzi.fr/proxmoxPanel/core/backend/internal/websocket"
|
||||||
"git.geronzi.fr/proxmoxPanel/core/backend/modules"
|
"git.geronzi.fr/proxmoxPanel/core/backend/modules"
|
||||||
viewlogs "git.geronzi.fr/proxmoxPanel/viewLogs"
|
|
||||||
viewservices "git.geronzi.fr/proxmoxPanel/viewServices"
|
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
|
|
@ -70,8 +68,6 @@ func main() {
|
||||||
|
|
||||||
// ── Chargement des modules actifs ──────────────────────────────────────
|
// ── Chargement des modules actifs ──────────────────────────────────────
|
||||||
loader := modules.NewLoader(database, sshPool, encryptor)
|
loader := modules.NewLoader(database, sshPool, encryptor)
|
||||||
loader.RegisterModule(viewlogs.New())
|
|
||||||
loader.RegisterModule(viewservices.New())
|
|
||||||
if err := loader.LoadActive(); err != nil {
|
if err := loader.LoadActive(); err != nil {
|
||||||
log.Fatalf("Erreur chargement modules : %v", err)
|
log.Fatalf("Erreur chargement modules : %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ services:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
container_name: proxmoxpanel-backend
|
container_name: proxmoxpanel-backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
expose:
|
expose:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue