File size: 896 Bytes
2eb87e3
 
 
 
 
 
 
 
 
 
 
d22337b
2eb87e3
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim AS builder
WORKDIR /workspace
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate

COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

COPY index.html postcss.config.js tailwind.config.js tsconfig.json vite.config.ts ./
COPY src ./src
COPY public ./public
ARG VITE_API_BASE_URL=https://openvuln.vulnhunter.pro
ARG VITE_GITHUB_REPO_URL=https://github.com/Clouditera/OpenVuln
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL \
    VITE_GITHUB_REPO_URL=$VITE_GITHUB_REPO_URL
RUN pnpm build

FROM nginx:1.27-alpine AS runtime
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /workspace/dist/ /usr/share/nginx/html/
EXPOSE 7860
HEALTHCHECK --interval=15s --timeout=3s --start-period=5s --retries=3 \
  CMD wget -qO- http://127.0.0.1:7860/health >/dev/null || exit 1