Dockerfile 457 B

1234567891011121314151617181920
  1. FROM node:18-alpine AS build
  2. WORKDIR /app
  3. COPY package*.json ./
  4. RUN if [ -f package-lock.json ]; then npm ci --no-audit --no-fund; else npm install --no-audit --no-fund; fi
  5. COPY . .
  6. ARG VITE_API_URL=/api/v1
  7. ENV VITE_API_URL=${VITE_API_URL}
  8. RUN npm run build
  9. FROM nginx:alpine
  10. COPY nginx.conf /etc/nginx/nginx.conf
  11. COPY --from=build /app/dist /usr/share/nginx/html
  12. EXPOSE 80
  13. HEALTHCHECK CMD wget -q -O - http://127.0.0.1:80/ >/dev/null 2>&1 || exit 1