Dockerfile 449 B

1234567891011121314151617181920212223
  1. FROM golang:1.12 AS compiler
  2. WORKDIR $GOPATH/src/github.com/msoedov/hacker-slides
  3. ENV GO111MODULE on
  4. RUN go mod download
  5. COPY . .
  6. RUN GOOS=linux CGO_ENABLE=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /bin/app *.go
  7. FROM alpine:3.8
  8. WORKDIR /srv
  9. ENV GIN_MODE=release
  10. RUN mkdir slides
  11. COPY --from=compiler /bin/app /bin/app
  12. COPY static static
  13. COPY templates templates
  14. COPY initial-slides.md initial-slides.md
  15. CMD app $PORT