mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
Add a Dockerfile and more configurable environment variables
This commit is contained in:
parent
2ec7f83d38
commit
2d010326c7
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM golang:1.14.2-alpine AS builder
|
||||
|
||||
RUN go env -w GO111MODULE=auto \
|
||||
&& go env -w CGO_ENABLED=0 \
|
||||
&& mkdir /build
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY ./ .
|
||||
|
||||
RUN cd /build \
|
||||
&& go build -ldflags "-s -w -extldflags '-static'" -o cqhttp
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
COPY --from=builder /build/cqhttp /usr/bin/cqhttp
|
||||
RUN chmod +x /usr/bin/cqhttp
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
ENTRYPOINT [ "/usr/bin/cqhttp" ]
|
Loading…
x
Reference in New Issue
Block a user