build: add Dockerfile to run the project in container (#262)

* Dockerfile added to build static files and serve with NGINX Distroless

* replaced final image distroless with official nginx unprivileged to support multi arch.

* runtime image to official nginx

* README updated

* docs: update README for Docker commands

---------

Co-authored-by: satnaing <satnaingdev@gmail.com>
This commit is contained in:
Micheal Choudhary
2024-07-16 04:19:40 +02:00
committed by GitHub
parent b9266cb20d
commit 47a3c8651e
3 changed files with 43 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
# Base stage for building the static files
FROM node:lts AS base
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Runtime stage for serving the application
FROM nginx:mainline-alpine-slim AS runtime
COPY --from=base ./app/dist /usr/share/nginx/html
EXPOSE 80