fix: dockerfile slim

This commit is contained in:
2023-10-21 23:49:59 +08:00
parent 0357905d87
commit 3bb5909053
2 changed files with 10 additions and 8 deletions

View File

@@ -1,11 +1,13 @@
FROM node:18-alpine3.18 as webui
RUN npm config set registry https://registry.npmmirror.com
COPY ./webui .
RUN npm install && npm run build
FROM images.local/golang:latest
WORKDIR /app
COPY . /app
RUN buf generate
RUN cd webui && npm install && npm run build &&\
cd .. && go mod tidy && go build .
COPY . .
COPY --from=0 dist ./webui/dist
RUN buf generate && go mod tidy && go build .
EXPOSE 38080
ENTRYPOINT [ "./pastebin", "api" ]