Dockerfile: move elm to its own step
This commit is contained in:
parent
4233054b6c
commit
9539843616
19
Dockerfile
19
Dockerfile
|
@ -1,21 +1,20 @@
|
||||||
FROM xena/go:1.13.5 AS build
|
FROM xena/go:1.13.5 AS go
|
||||||
WORKDIR /mi
|
WORKDIR /mi
|
||||||
COPY go.mod .
|
COPY go.mod .
|
||||||
COPY go.sum .
|
COPY go.sum .
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN GOBIN=/mi/bin go install ./cmd/...
|
RUN GOBIN=/mi/bin go install ./cmd/...
|
||||||
RUN apk --no-cache add curl \
|
|
||||||
&& curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz \
|
FROM xena/elm:0.19.1 AS elm
|
||||||
&& gunzip elm.gz \
|
WORKDIR /mi
|
||||||
&& chmod +x ./elm \
|
COPY ./frontend .
|
||||||
&& mv elm /usr/local/bin \
|
RUN elm make --output main.js src/Main.elm
|
||||||
&& cd ./frontend \
|
|
||||||
&& elm make --output ../static/main.js src/Main.elm
|
|
||||||
|
|
||||||
FROM xena/alpine
|
FROM xena/alpine
|
||||||
COPY --from=build /mi/bin /usr/local/bin
|
COPY --from=go /mi/bin /usr/local/bin
|
||||||
COPY ./run /run
|
COPY ./run /run
|
||||||
COPY --from=build /mi/static /mi/static
|
COPY --from=go /mi/static /mi/static
|
||||||
|
COPY --from=elm /mi/main.js /mi/static/main.js
|
||||||
WORKDIR /mi
|
WORKDIR /mi
|
||||||
CMD ["/bin/sh", "/run/start.sh"]
|
CMD ["/bin/sh", "/run/start.sh"]
|
||||||
|
|
Loading…
Reference in New Issue