Dockerfile 366 B

12345678910111213
  1. # syntax=docker/dockerfile:1
  2. FROM node:18-alpine AS build
  3. WORKDIR /app
  4. RUN npm config set registry https://registry.npmmirror.com
  5. COPY package*.json ./
  6. RUN --mount=type=cache,target=/root/.npm npm ci --legacy-peer-deps
  7. COPY . .
  8. RUN npx vite build
  9. FROM nginx:1.27-alpine
  10. COPY --from=build /app/dist /usr/share/nginx/html
  11. EXPOSE 80
  12. CMD ["nginx", "-g", "daemon off;"]