1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-12 06:45:46 +08:00

Merge pull request #47 from purerosefallen/patch-1

Add Dockerfile
This commit is contained in:
Mrs4s 2020-08-10 16:57:34 +08:00 committed by GitHub
commit 5d2e202b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
.gitlab-ci.yml
.dockerignore
Dockerfile
README.md
LICENSE

21
Dockerfile Normal file
View 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" ]