Files
testpf/frontend/Dockerfile
2026-03-19 16:21:46 +07:00

30 lines
585 B
Docker

FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package.json
COPY vite.config.js vite.config.js
RUN npm install
FROM node:22-alpine AS build
WORKDIR /app
ARG VITE_API_BASE_URL=http://localhost:4000/api
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
COPY --from=deps /app/node_modules node_modules
COPY package.json package.json
COPY vite.config.js vite.config.js
#COPY public public
COPY src src
COPY index.html index.html
RUN npm run build
FROM nginx:1.27-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80