FROM dockerhub.timeweb.cloud/golang:alpine AS builder #NOTE(lain/kroot) dockerhub doesnt work on my machine, so I use this image from other "mirror" registry WORKDIR /app ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 COPY go.mod go.sum ./ RUN go mod download COPY . . RUN go build -o ghproxy ./cmd/ghproxy FROM dockerhub.timeweb.cloud/alpine:edge WORKDIR /app RUN addgroup -S app && adduser -S app -G app COPY --from=builder /app/ghproxy /app/ghproxy COPY config.yaml /app/config.yaml EXPOSE 8080 USER app ENTRYPOINT ["/app/ghproxy"]