mi-v1/Dockerfile

24 lines
508 B
Docker

FROM xena/go:1.13.6 AS go
WORKDIR /mi
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN GOBIN=/mi/bin go install ./cmd/...
FROM xena/elm:0.19.1 AS elm
RUN apk --no-cache add nodejs npm \
&& npm install -g elm-spa \
&& npm install -g uglify-js
WORKDIR /mi
COPY ./frontend .
RUN sh build.sh
FROM xena/alpine
COPY --from=go /mi/bin /usr/local/bin
COPY ./run /run
COPY --from=go /mi/static /mi/static
COPY --from=elm /mi/main.min.js /mi/static/main.js
WORKDIR /mi
CMD ["/bin/sh", "/run/start.sh"]