RegWatch frontend : React/Vite -> nginx + Docker/CI homelab
Build & Deploy / build (push) Successful in 18s
Build & Deploy / build (push) Successful in 18s
- URL d'API externalisée (VITE_API_URL bakée au build), plus de localhost en dur - Dockerfile multi-stage pnpm build -> nginx (fallback SPA) - docker-compose (Watchtower) + .gitea/workflows/build.yml Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
# --- build (Vite bake VITE_API_URL au build) ---
|
||||
FROM node:24-alpine AS build
|
||||
WORKDIR /app
|
||||
RUN npm install -g pnpm@latest
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --no-frozen-lockfile
|
||||
COPY . .
|
||||
# URL publique de l'API, injectée dans le bundle au build (Vite n'a pas d'env au runtime).
|
||||
ARG VITE_API_URL=https://regwatch-api.nfteam.ovh
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
RUN pnpm build
|
||||
|
||||
# --- serve (nginx statique, fallback SPA) ---
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user