40 lines
809 B
Docker
40 lines
809 B
Docker
# ------------------------
|
||
# 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. don’t 404)
|
||
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||
|
||
# EXPOSE 80
|
||
# CMD ["nginx", "-g", "daemon off;"]
|