From 5599dc9e4b7ba43e994de0dde6c3db22661d9be2 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 7 Jan 2020 01:12:55 +0100 Subject: [PATCH] Add frontend to container Signed-off-by: Knut Ahlers --- Dockerfile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 74549b1..2b61a52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,16 @@ +FROM alpine as prefetch + +COPY . /src +WORKDIR /src + +RUN set -ex \ + && apk add \ + bash \ + curl \ + make \ + && make assets + + FROM golang:alpine as builder COPY . /go/src/github.com/Luzifer/mapshare @@ -17,9 +30,11 @@ RUN set -ex \ && apk --no-cache add \ ca-certificates -COPY --from=builder /go/bin/mapshare /usr/local/bin/mapshare +COPY --from=builder /go/bin/mapshare /usr/local/bin/mapshare +COPY --from=prefetch /src/frontend /usr/local/share/mapshare/frontend EXPOSE 3000 +WORKDIR /usr/local/share/mapshare ENTRYPOINT ["/usr/local/bin/mapshare"] CMD ["--"]