refactor: réorganiser Dockerfiles et scripts par module
Réorganise la structure Docker pour plus de cohérence dans le monorepo. Chaque module (backend, docs) a maintenant ses propres Dockerfiles et scripts. Changements: - backend/docker/ : Dockerfile (prod) + dev.Dockerfile (hot reload) + init script - docs/docker/ : mkdocs.Dockerfile + pdf.Dockerfile - docs/scripts/ : generate-bdd-docs.py + generate-pdf-docs.py - Déplace docker-compose.yml dans backend/ - Supprime scripts obsolètes (fix-markdown-*.sh, remove-broken-links.sh) - Déplace .dockerignore à la racine - Met à jour Makefile avec nouveaux chemins Organisation finale: - backend/ : tout ce qui concerne l'API backend - docs/ : tout ce qui concerne la documentation - scripts/ : uniquement setup.sh (scripts généraux du projet)
This commit is contained in:
33
backend/docker/Dockerfile
Normal file
33
backend/docker/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
# Builder stage
|
||||
FROM golang:1.23-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git ca-certificates
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod files
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags="-w -s" -o /bin/api ./cmd/api
|
||||
|
||||
# Final stage
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk --no-cache add ca-certificates ffmpeg
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
# Copy binary from builder
|
||||
COPY --from=builder /bin/api .
|
||||
|
||||
# Copy config files
|
||||
COPY config/ ./config/
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./api"]
|
||||
Reference in New Issue
Block a user