Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Oct 4, 2019
1 parent 83a7a9c commit 1d873e0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Prepare
FROM golang:1.13-alpine as baseimg

RUN apk --no-cache upgrade && apk --no-cache add git make

# First only download the dependencies, so thid layer can be cahced before we copy the code
COPY ./go.mod ./go.sum ./Makefile /app/
WORKDIR /app/
RUN make deps

# Build
FROM baseimg as builder

COPY . ./
RUN make build

# Run
FROM alpine

COPY --from=builder /app/go-skeleton /opt/
WORKDIR /opt/
ARG ENV
EXPOSE 8000
CMD ["./go-skeleton"]

0 comments on commit 1d873e0

Please sign in to comment.