Dockerfile 1.04 KB
Newer Older
1
FROM gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/automata-library/cli:snapshot as static_files_generator
2

3 4 5
ARG VERSION="<unknown>"

ADD ./webui/json_generators /app
6 7 8
ADD cmake ./app/cmake
WORKDIR /app

Tomáš Pecka's avatar
Tomáš Pecka committed
9 10 11
RUN apk add jsoncpp-dev build-base cmake samurai
RUN cmake . -DCMAKE_MODULE_PATH=cmake -GNinja && \
    ninja -j$(grep -c processor /proc/cpuinfo) && \
12 13 14 15
    mkdir -p static_jsons/ && \
    ./algorithms-json         > static_jsons/algorithms.json && \
    ./version-json "$VERSION" > static_jsons/version.json

16 17 18 19 20 21 22

#-----------------------------------------------------------------------------------------

FROM alpine:3.9 AS builder_webui

ADD ./webui /app
WORKDIR /app
23
COPY --from=static_files_generator /app/static_jsons/ src/static_jsons/
24 25 26 27 28 29 30 31
RUN apk add --no-cache nodejs npm && \
		npm install && \
		npm run build

# ----------------------------------------------------------------------------------------

FROM nginx:alpine as webui

Michael Vrána's avatar
Michael Vrána committed
32
COPY webui/nginx/default.conf /etc/nginx/conf.d/default.conf
33
COPY --from=builder_webui /app/build /usr/share/nginx/html