Release / Plano (reaproveitar a imagem?) (push) Successful in 6s
CI / Tipos e testes (push) Successful in 1m0s
CI / Trivy (dependências e segredos) (push) Successful in 6s
CI / Imagem Docker (linux/arm64) (push) Failing after 37s
Release / ci (push) Failing after 1m44s
Release / Publica a imagem (linux/arm64) (push) Skipped
Release / Cria a release no Gitea (push) Skipped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
25 lines
820 B
Docker
25 lines
820 B
Docker
# 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: nginx sem privilégios (usuário nginx, porta 8080) e os estáticos ──
|
|
FROM nginxinc/nginx-unprivileged:alpine
|
|
# Aplica as correções de segurança do Alpine publicadas depois da imagem base.
|
|
USER root
|
|
RUN apk upgrade --no-cache
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
USER nginx
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
|
CMD wget -q --spider http://127.0.0.1:8080/ || exit 1
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|