Skip to content

Commit

Permalink
👷🏻Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
iyadh committed Jan 5, 2024
1 parent be4fa40 commit c2f9654
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Build Stage
# Step 1: Build the application
FROM node:18-alpine AS build-stage
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install
COPY . .
RUN yarn build

# Production Stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Step 2: Serve the application using a static server
FROM node:18-alpine as serve-stage
WORKDIR /app
COPY --from=build-stage /app/dist /app
RUN yarn global add serve
EXPOSE 8001
CMD ["nginx", "-g", "daemon off;"]
CMD ["serve", "-s", ".", "-l", "8001"]
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
base: './',
base: '/price-calculator/',
});

1 comment on commit c2f9654

@vercel
Copy link

@vercel vercel bot commented on c2f9654 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.