Create docker

This commit is contained in:
Eden Kirin
2024-01-28 21:49:03 +01:00
parent 5a43ce875f
commit 8a97b3daf6
3 changed files with 48 additions and 0 deletions

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
# stage 1: build node frontend
FROM node:21 as node-builder
WORKDIR /node-builder
COPY ./public ./public
COPY ./src ./src
COPY ./package.json .
COPY ./package-lock.json .
COPY ./tsconfig.json .
RUN \
npm install && \
npm run build
FROM busybox:1.36-musl
RUN adduser -D pingator
USER pingator
WORKDIR /www
COPY --from=node-builder /node-builder/build /www
# Run BusyBox httpd
CMD ["busybox", "httpd", "-f", "-v", "-h", "/www", "-p", "3000"]