diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..219c8f7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM golang:1.26.3-alpine3.22 AS backendBuilder + +RUN apk add --no-cache gcc g++ + +COPY ./backend /source + +RUN cd /source && \ + CGO_ENABLED=1 go build + +FROM node:22.22.3-trixie AS frontendBuilder + +COPY ./frontend /source + +RUN cd /source && \ + rm -rf ./dist ./distMinified ./node_modules && \ + npm install --ignore-scripts && \ + npm run build + +FROM alpine:3.22.4 + +RUN mkdir -p /website + +COPY --from=backendBuilder /source/backend /website/server +COPY --from=frontendBuilder /source/distMinified /website/static + +ENV PORT=80 +ENV FRONTEND_PATH=/website/static + +EXPOSE 80 + +ENTRYPOINT ["/website/server"]