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