Last change
on this file since 130 was 115, checked in by asciimoo, 5 years ago |
Merge pull request #92 from dalf/dependencies-upgrade
[mod] dependencies upgrades
|
File size:
609 bytes
|
Rev | Line | |
---|
[90] | 1 | # STEP 1 build executable binary
|
---|
[114] | 2 | FROM golang:1.14-alpine as builder
|
---|
[90] | 3 |
|
---|
| 4 | WORKDIR $GOPATH/src/github.com/asciimoo/morty
|
---|
| 5 |
|
---|
| 6 | RUN apk add --no-cache git
|
---|
| 7 |
|
---|
| 8 | COPY . .
|
---|
| 9 | RUN go get -d -v
|
---|
[92] | 10 | RUN gofmt -l ./
|
---|
| 11 | #RUN go vet -v ./...
|
---|
| 12 | #RUN go test -v ./...
|
---|
[90] | 13 | RUN go build .
|
---|
| 14 |
|
---|
| 15 | # STEP 2 build the image including only the binary
|
---|
[114] | 16 | FROM alpine:3.12
|
---|
[90] | 17 |
|
---|
| 18 | EXPOSE 3000
|
---|
| 19 |
|
---|
[92] | 20 | RUN apk --no-cache add ca-certificates \
|
---|
| 21 | && rm -f /var/cache/apk/* \
|
---|
| 22 | && adduser -D -h /usr/local/morty -s /bin/false morty morty
|
---|
[90] | 23 |
|
---|
[92] | 24 | COPY --from=builder /go/src/github.com/asciimoo/morty/morty /usr/local/morty/morty
|
---|
[90] | 25 |
|
---|
[91] | 26 | USER morty
|
---|
| 27 |
|
---|
[97] | 28 | ENV DEBUG=true
|
---|
| 29 |
|
---|
[91] | 30 | ENTRYPOINT ["/usr/local/morty/morty"]
|
---|
Note:
See
TracBrowser
for help on using the repository browser.