mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-13 23:31:07 +08:00
47a3c8651e
* 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>
12 lines
290 B
Docker
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 |