go-bouquins/Dockerfile

26 lines
771 B
Docker
Raw Permalink Normal View History

2019-07-02 18:16:13 +00:00
FROM golang as builder
ARG version
2019-07-02 18:16:13 +00:00
WORKDIR /go/src/meutel.net/meutel/go-bouquins
COPY . .
2019-09-12 13:10:08 +00:00
RUN GO111MODULE=on go get .
RUN GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build -ldflags "-X main.version=$version" -a -installsuffix cgo -o app .
2019-09-12 13:10:08 +00:00
RUN curl -X POST -s --data-urlencode 'input@assets/css/bouquins.css' https://cssminifier.com/raw > assets/css/bouquins.min.css
2019-07-02 18:16:13 +00:00
# deployment image
FROM debian:stable-slim
LABEL author="Meutel"
WORKDIR /root/
2019-07-03 18:08:23 +00:00
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -y install ca-certificates && update-ca-certificates -f
2019-07-02 18:16:13 +00:00
COPY --from=builder /go/src/meutel.net/meutel/go-bouquins/app .
COPY templates/ ./templates/
2019-09-12 13:10:08 +00:00
COPY --from=builder /go/src/meutel.net/meutel/go-bouquins/assets/ ./assets/
2019-07-02 18:16:13 +00:00
CMD [ "./app" ]
EXPOSE 8080