mirror of
https://github.com/sky22333/qqbot.git
synced 2026-08-05 07:06:40 +08:00
add docker
This commit is contained in:
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM golang:1.26-alpine AS builder
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum .
|
||||
RUN go mod download && apk add upx --no-cache
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -trimpath -o qqbot . && upx -9 qqbot
|
||||
|
||||
FROM alpine
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
COPY --from=builder /app/qqbot .
|
||||
COPY --from=builder /app/configs/config.toml .
|
||||
|
||||
CMD ["./qqbot", "-config", "config.toml"]
|
||||
Reference in New Issue
Block a user