arshenoy commited on
Commit
db6d1db
·
verified ·
1 Parent(s): fb2c15f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Stage 1: Build
2
  FROM node:18-alpine as build
3
  WORKDIR /app
4
  COPY package*.json ./
@@ -7,10 +7,11 @@ COPY . .
7
  ARG VITE_API_KEY
8
  ENV VITE_API_KEY=$VITE_API_KEY
9
  RUN npm run build
10
- # Stage 2: Serve
 
11
  FROM nginx:alpine
12
  COPY --from=build /app/dist /usr/share/nginx/html
13
- Copy a simple nginx config to handle React routing
14
  RUN echo 'server { listen 7860; location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf
15
  EXPOSE 7860
16
  CMD ["nginx", "-g", "daemon off;"]
 
1
+ # --- Stage 1: Build ---
2
  FROM node:18-alpine as build
3
  WORKDIR /app
4
  COPY package*.json ./
 
7
  ARG VITE_API_KEY
8
  ENV VITE_API_KEY=$VITE_API_KEY
9
  RUN npm run build
10
+
11
+ # --- Stage 2: Serve ---
12
  FROM nginx:alpine
13
  COPY --from=build /app/dist /usr/share/nginx/html
14
+ # Copy a simple nginx config to handle React routing
15
  RUN echo 'server { listen 7860; location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf
16
  EXPOSE 7860
17
  CMD ["nginx", "-g", "daemon off;"]