feat: fix vite url using env var

This commit is contained in:
2025-06-25 20:25:33 -04:00
parent c0eae42daf
commit 60c9cec7aa
6 changed files with 18 additions and 45 deletions
+8 -9
View File
@@ -1,15 +1,14 @@
# Build stage
FROM node:20 AS build
FROM node:20 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
RUN npm run build
# Production stage
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app ./
EXPOSE 3000
CMD ["npx", "vite", "--port", "3000"]