changed docker #16

Merged
hardik merged 1 commits from fix/ssh_issue into main 2025-09-29 15:28:05 +05:30
3 changed files with 13 additions and 20 deletions

View File

@ -7,33 +7,26 @@ 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
# ------------------------
# Run stage (Node-based)
# ------------------------
FROM node:22-bullseye
# # ------------------------
# # Production stage
# # ------------------------
# FROM nginx:stable-alpine
WORKDIR /app
# # Copy React build output to Nginx html folder
# COPY --from=builder /app/build /usr/share/nginx/html
# Install `serve` globally
RUN npm install -g serve
# # Optional: custom nginx config for React Router
# # (so /about, /contact etc. dont 404)
# COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built files
COPY --from=builder /app/dist .
# EXPOSE 80
# CMD ["nginx", "-g", "daemon off;"]
EXPOSE 3000
CMD ["serve", "-s", ".", "-l", "3000"]

2
package-lock.json generated
View File

@ -61,7 +61,7 @@
"@vitejs/plugin-react-swc": "^3.10.2",
"eslint": "^9.36.0",
"eslint-plugin-unused-imports": "^4.2.0",
"vite": "6.3.5"
"vite": "^6.3.5"
}
},
"node_modules/@babel/runtime": {

View File

@ -56,7 +56,7 @@
"@vitejs/plugin-react-swc": "^3.10.2",
"eslint": "^9.36.0",
"eslint-plugin-unused-imports": "^4.2.0",
"vite": "6.3.5"
"vite": "^6.3.5"
},
"scripts": {
"dev": "vite",