aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/server/Dockerfile
blob: 609c1ff73e8927340b3600e297474bf482d28da3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# To build, run from the top-level directory:
# docker build -f server/Dockerfile -t egortensin/math-server .

FROM alpine:3.11

LABEL maintainer="Egor Tensin <Egor.Tensin@gmail.com>"

ENV src_dir=/usr/src/math-server
COPY [".", "$src_dir"]

RUN build_deps='boost-dev cmake g++ make python3' && \
    apk add --no-cache $build_deps && \
    "$src_dir/cmake/cmake/build/build.py" \
        --install /usr/local \
        --configuration Release \
        -- \
        "$src_dir" \
        -D ENABLE_TESTS=ON \
        -D Boost_USE_STATIC_LIBS=OFF && \
    rm -rf -- "$src_dir" && \
    apk del --purge --rdepends $build_deps && \
    runtime_deps='boost-filesystem boost-program_options boost-regex boost-unit_test_framework libstdc++' && \
    apk add $runtime_deps && \
    /usr/local/bin/math-server-unit-tests --log_level=all

CMD ["/usr/local/bin/math-server"]