mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
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:
committed by
GitHub
parent
b9266cb20d
commit
47a3c8651e
+12
@@ -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
|
||||
Reference in New Issue
Block a user