Ajoute les workflows Gitea Actions et l'image du front
- .gitea/workflows/test-build.yaml : construction des images et jobs de tests (back-end : ruff, migrations, pytest ; front : lint, types, tests, build) sur les pull requests - .gitea/workflows/build-and-release.yaml : publication des images sur Harbor à chaque tag - frontend/Dockerfile, nginx.conf, .dockerignore : image du front (nginx sans privilèges sur le port 8080, relais de /api, /admin et /static vers le back-end du pod) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0617fa8dc4
commit
ec729d604f
5 files changed
+197
No files matched your search
@@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
dist
|
||||
.eslintcache
|
||||
Dockerfile
|
||||
@@ -0,0 +1,17 @@
|
||||
FROM node:24-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build-only
|
||||
|
||||
# Sert le front et relaie /api, /admin et /static vers le back-end du même pod (port 8000).
|
||||
FROM nginxinc/nginx-unprivileged:1.27-alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 8080
|
||||
@@ -0,0 +1,29 @@
|
||||
server {
|
||||
listen 8080;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Le back-end tourne dans le même pod que ce conteneur.
|
||||
location ~ ^/(api|admin|static)/ {
|
||||
proxy_pass http://127.0.0.1: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;
|
||||
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
|
||||
# Fichiers versionnés par Vite : cache long.
|
||||
location /assets/ {
|
||||
try_files $uri =404;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
|
||||
# Application monopage : toute autre route retombe sur index.html.
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
add_header Cache-Control "no-cache";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user