changed docker #16
29
Dockerfile
29
Dockerfile
|
|
@ -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. don’t 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"]
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue