2019-06-13 12:29:15 +02:00
|
|
|
FROM golang:1.12 AS compiler
|
|
|
|
|
|
|
|
WORKDIR $GOPATH/src/github.com/msoedov/hacker-slides
|
|
|
|
|
|
|
|
ENV GO111MODULE on
|
2019-06-28 12:23:05 +02:00
|
|
|
RUN go mod download
|
|
|
|
|
2019-06-13 12:29:15 +02:00
|
|
|
COPY . .
|
2019-06-28 12:23:05 +02:00
|
|
|
RUN GOOS=linux CGO_ENABLE=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /bin/app *.go
|
|
|
|
|
2019-06-13 12:29:15 +02:00
|
|
|
|
|
|
|
|
2019-01-12 18:06:40 +01:00
|
|
|
FROM alpine:3.8
|
2017-01-29 15:24:04 +01:00
|
|
|
|
2019-06-13 12:29:15 +02:00
|
|
|
WORKDIR /srv
|
2017-01-29 15:24:04 +01:00
|
|
|
|
2017-02-08 02:02:51 +01:00
|
|
|
ENV GIN_MODE=release
|
2019-06-13 12:29:15 +02:00
|
|
|
RUN mkdir slides
|
|
|
|
COPY --from=compiler /bin/app /bin/app
|
|
|
|
COPY static static
|
|
|
|
COPY templates templates
|
|
|
|
COPY initial-slides.md initial-slides.md
|
|
|
|
CMD app $PORT
|