Skip to content

Commit 5e4b165

Browse files
committed
update Dockerfile
1 parent b91170d commit 5e4b165

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
FROM golang
2-
COPY . go_wechaty_examples
1+
FROM golang AS builder
2+
WORKDIR /root/
3+
COPY . src
34
ENV GOPROXY https://goproxy.io,direct
4-
RUN cd go_wechaty_examples && make test
5-
ENTRYPOINT ./go_wechaty_examples/ding-dong-bot
5+
RUN cd src && CGO_ENABLED=0 GOOS=linux go build -o ding-dong-bot -v ./examples/ding-dong-bot.go
6+
7+
FROM alpine AS prod
8+
WORKDIR /root/
9+
COPY --from=builder /root/src/ding-dong-bot .
10+
ENTRYPOINT ["./ding-dong-bot"]

0 commit comments

Comments
 (0)