Skip to content

Commit

Permalink
Update Dockerfile (#39)
Browse files Browse the repository at this point in the history
Set up a proxy for Go
  • Loading branch information
forose authored Jun 19, 2024
1 parent f93a0ed commit e251e9e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
FROM golang:alpine AS builder

WORKDIR /app
COPY . .

ADD . .
ENV GO111MODULE=on GOPROXY=https://goproxy.cn,direct
RUN go mod download

RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o override
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o override

FROM alpine:latest

COPY --from=builder /app/override /usr/local/bin/override
RUN apk --no-cache add ca-certificates

WORKDIR /app
COPY --from=builder /app/override /usr/local/bin/
COPY config.json.example /app/config.json

ENTRYPOINT ["/usr/local/bin/override"]
WORKDIR /app
VOLUME /app

EXPOSE 8181
EXPOSE 8080
CMD ["override"]

0 comments on commit e251e9e

Please sign in to comment.