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
Showing only changes of commit c7aa66f49d - Show all commits

View File

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

2
package-lock.json generated
View File

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

View File

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