Files
MyBlog-Next/Dockerfile
T
Micheal Choudhary 47a3c8651e 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>
2024-07-16 09:19:40 +07:00

12 lines
290 B
Docker

# 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