ci: imagem construída do código, esteira para os runners do Gitea e changelog
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
47586bcc7b
commit
ab7f532456
18 files changed
+520
-45
No files matched your search
+14
-7
@@ -1,13 +1,20 @@
|
||||
# ── Production image ──
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# ── Build: compila o Vite a partir do código, sem artefato pré-construído ──
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# ── Imagem final: só o nginx e os arquivos estáticos ──
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Unpack pre-built Vite output
|
||||
COPY dist.tar.gz /usr/share/nginx/html/
|
||||
RUN tar -xzf /usr/share/nginx/html/dist.tar.gz --strip-components=1 -C /usr/share/nginx/html \
|
||||
&& rm /usr/share/nginx/html/dist.tar.gz
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
||||
CMD wget -q --spider http://127.0.0.1:80/ || exit 1
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in new issue
Block a user