24 lines
533 B
Docker
24 lines
533 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
|
|
WORKDIR /mi
|
|
COPY ./frontend .
|
|
RUN elm-spa build . \
|
|
&& elm make --output main.js src/Main.elm --optimize
|
|
|
|
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.js /mi/static/main.js
|
|
WORKDIR /mi
|
|
CMD ["/bin/sh", "/run/start.sh"]
|