fix: dockerfile slim

This commit is contained in:
xuthus5 2023-10-21 23:49:59 +08:00
parent 0357905d87
commit 3bb5909053
Signed by: xuthus5
GPG Key ID: A23CF9620CBB55F9
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" ]

4
go.mod
View File

@ -1,13 +1,13 @@
module pastebin
go 1.20
go 1.21.0
require (
github.com/gin-gonic/gin v1.9.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/sqids/sqids-go v0.4.1
gitter.top/coco/coco v0.0.0-20231013143029-cb23d9e80ddd
gitter.top/coco/coco v0.0.1
gitter.top/common/lormatter v0.0.0-20230910075849-28d49dccd03a
gitter.top/drivers/sdbc v0.0.0-20230929063242-b4baa9aa7ff8
google.golang.org/protobuf v1.31.0