feat: déploiement Docker en conteneur unique (API + UI)
Le backend FastAPI sert déjà le SPA buildé : on abandonne le duo nginx + backend au profit d'une seule image multi-stage (build Vue puis service par le backend). docker-compose passe à un service unique, avec PLESNA_DATA_DIR déclarant le stockage persistant. - backend.Dockerfile : stage node build -> copie frontend/dist, CMD en `uv run --no-sync` (plus de resync des deps dev au démarrage) - docker-compose.yml : service unique `app`, volume ./data, PLESNA_DATA_DIR=/app/data - supprime frontend/Dockerfile, frontend/nginx.conf, frontend/.dockerignore - .dockerignore : ignore **/node_modules, data, data_bck - README : section Production mise à jour Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
node_modules
|
||||
dist
|
||||
@@ -1,12 +0,0 @@
|
||||
FROM node:22-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
@@ -1,19 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Proxy API requests to backend
|
||||
location /api {
|
||||
proxy_pass http://backend:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
|
||||
# SPA fallback
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user