sangwaritaxi_website/Dockerfile

40 lines
809 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ------------------------
# Build stage
# ------------------------
FROM node:22-bullseye AS builder
ARG API_BASE_URL="https://navigolabs.com/api"
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy all source files
COPY . .
# Pass API URL to Vite
ENV VITE_API_BASE_URL=$API_BASE_URL
# Build the React app
RUN npm run build
# # ------------------------
# # Production stage
# # ------------------------
# FROM nginx:stable-alpine
# # Copy React build output to Nginx html folder
# COPY --from=builder /app/build /usr/share/nginx/html
# # Optional: custom nginx config for React Router
# # (so /about, /contact etc. dont 404)
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# EXPOSE 80
# CMD ["nginx", "-g", "daemon off;"]