Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# build image

FROM golang:alpine AS build

WORKDIR /go/src/github.com/rdegges/ipify-api
COPY . /go/src/github.com/rdegges/ipify-api
RUN go build

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/go/src/github.com/rdegges/ipify-api/ipify-api"]

# live image

FROM build AS live
EXPOSE 3000/tcp

RUN apk upgrade \
&& apk add --update dumb-init \
&& rm /var/cache/apk/*

COPY --from=build /go/src/github.com/rdegges/ipify-api/ipify-api /go/bin/

CMD ["/go/bin/ipify-api"]