yukari/Dockerfile
alex 3635bc8bf8 [mod] dependencies upgrades
* fasthttp v1.14.0
* net v0.0.0-20200707034311-ab3426394381
* text v0.3.3

* Dockerfile: golang:1.14-alpine, alpine:3.12 (add support for TLS1.3)

git-svn-id: file:///srv/svn/repo/yukari/trunk@114 f3bd38d9-da89-464d-a02a-eb04e43141b5
2020-07-14 08:29:25 +00:00

31 lines
609 B
Docker

# STEP 1 build executable binary
FROM golang:1.14-alpine as builder
WORKDIR $GOPATH/src/github.com/asciimoo/morty
RUN apk add --no-cache git
COPY . .
RUN go get -d -v
RUN gofmt -l ./
#RUN go vet -v ./...
#RUN go test -v ./...
RUN go build .
# STEP 2 build the image including only the binary
FROM alpine:3.12
EXPOSE 3000
RUN apk --no-cache add ca-certificates \
&& rm -f /var/cache/apk/* \
&& adduser -D -h /usr/local/morty -s /bin/false morty morty
COPY --from=builder /go/src/github.com/asciimoo/morty/morty /usr/local/morty/morty
USER morty
ENV DEBUG=true
ENTRYPOINT ["/usr/local/morty/morty"]