build: add production frontend images
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --no-audit --no-fund
|
||||
|
||||
COPY . .
|
||||
|
||||
ARG VITE_APP_BASE_URL=https://api.sbnews.net
|
||||
ENV VITE_APP_BASE_URL=${VITE_APP_BASE_URL}
|
||||
|
||||
RUN npx vite build
|
||||
|
||||
FROM registry.cn-guangzhou.aliyuncs.com/likeadmin/nginx:1.23.1
|
||||
|
||||
COPY --from=build /app/dist/ /usr/share/nginx/html/
|
||||
Reference in New Issue
Block a user