chore: init repository
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM golang:1.13-alpine as builder
|
||||
ENV GO111MODULE=on
|
||||
# Remove the cache to avoid warning message during `apk info`
|
||||
RUN rm -rf /var/cache/apk/* && \
|
||||
rm -rf /tmp/*
|
||||
|
||||
RUN apk update
|
||||
|
||||
# GO and PATH env variables already set in golang image
|
||||
# to reduce download time
|
||||
RUN apk --no-cache add -U make git musl-dev gcc
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN make local-build
|
||||
|
||||
# final stage
|
||||
FROM alpine:3.7
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /go/bin/john .
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT ["/app/john"]
|
||||
CMD ["serve", "--logformat", "json", "--loglevel", "debug"]
|
||||
Reference in New Issue
Block a user