sangwaritaxi_website/Dockerfile

28 lines
565 B
Docker

# Stage 1: Build
FROM node:20-bullseye AS builder
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm install
# Copy the rest of the source code
COPY . .
# Set environment variable for Vite (customize as needed)
ENV VITE_API_BASE_URL=https://navigolabs.com/api
# Build the Vite app
RUN npm run build
# Stage 2: Serve with Node
FROM node:20-bullseye
WORKDIR /app
RUN npm install -g serve
# Copy build output from builder
COPY --from=builder /app/build .
EXPOSE 3000
CMD ["serve", "-s", ".", "-l", "3000"]