muerwre.github.io/content/Docker/Building static pages with Docker.md
2022-11-03 10:38:11 +06:00

306 B

Sample #Dockerfile for static Typescript builds such a #nextjs, #gatsby or #nuxt:

FROM node:16-alpine as builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn
COPY . .

# your generate command here
RUN yarn generate

FROM nginx
COPY --from=builder /app/dist /usr/share/nginx/html