aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/Dockerfile38
1 files changed, 16 insertions, 22 deletions
diff --git a/server/Dockerfile b/server/Dockerfile
index f5248ae..27aab08 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -1,32 +1,26 @@
# To build, run from the top-level directory:
# docker build -f server/Dockerfile -t egortensin/math-server .
-FROM debian
+FROM alpine:3.11
LABEL maintainer="Egor Tensin <Egor.Tensin@gmail.com>"
-# Don't prompt:
-ENV DEBIAN_FRONTEND=noninteractive
-
-RUN apt-get update -yq \
- && apt-get install -yq --no-install-recommends \
- build-essential \
- cmake \
- libboost-filesystem-dev \
- libboost-program-options-dev \
- libboost-test-dev \
- python3
-
-ENV src_dir=/usr/src/app
-
+ENV src_dir=/usr/src/math-server
COPY [".", "$src_dir"]
-RUN "$src_dir/cmake/ci/build.py" \
- --src "$src_dir" \
- --install /usr/local \
- --clean \
- --configuration Release \
- -- -DENABLE_TESTS=ON \
- && /usr/local/bin/math-server-unit-tests --log_level=all
+RUN build_deps='boost-dev cmake g++ make python3' && \
+ apk add --no-cache $build_deps && \
+ "$src_dir/cmake/ci/build.py" \
+ --src "$src_dir" \
+ --install /usr/local \
+ --clean \
+ --configuration Release \
+ -- -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-unit_test_framework libstdc++' && \
+ apk add $runtime_deps && \
+ /usr/local/bin/math-server-unit-tests --log_level=all
CMD ["/usr/local/bin/math-server"]