site/Dockerfile

21 lines
369 B
Docker
Raw Normal View History

2023-05-08 10:15:59 +00:00
FROM node:20 as builder
WORKDIR /app
RUN npm install -g pnpm@8
COPY . .
RUN pnpm install && pnpm build
# See https://lipanski.com/posts/smallest-docker-image-static-website
FROM busybox:1.36
RUN adduser -D static
USER static
WORKDIR /home/static
COPY --from=builder /app/public .
# Run BusyBox httpd
EXPOSE 3000
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"]