Skip to content

Commit

Permalink
Updated DOCKERFILE with multi-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanaem committed Jan 24, 2025
1 parent eeede3c commit 6fa5d72
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM node:20
FROM node:20-alpine AS build

WORKDIR /app

COPY . .

RUN npm ci

EXPOSE 5173
RUN npm run build

ENTRYPOINT npm run build && npm run preview

FROM nginx:alpine

COPY --from=build /app/dist /usr/share/nginx/html

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 80

ENTRYPOINT [ "/entrypoint.sh" ]

CMD ["nginx"]

0 comments on commit 6fa5d72

Please sign in to comment.