Merge pull request #2 from kzw200015/master

Add Docker Support
This commit is contained in:
iyear 2020-04-08 12:23:45 +08:00 committed by GitHub
commit fa5712dc77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM golang:alpine AS builder
WORKDIR /root
RUN apk update && apk add git \
&& git clone https://github.com/iyear/E5SubBot.git \
&& cd E5SubBot && go build
FROM alpine:latest
ENV TIME_ZONE=Asia/Shanghai
RUN apk update && apk add tzdata \
&& ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone
WORKDIR /root
COPY --from=builder /root/E5SubBot/main /root
CMD [ "/root/main" ]