aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2019-12-09 16:08:32 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2019-12-09 16:08:32 +0300
commit0a59c0d1a22461185247b7cc948b171cb26631cb (patch)
tree0e6531612063f743421f18bb1486436caa15c7b0
parentlink to pthreads in CMakeLists.txt (diff)
downloadmath-server-0a59c0d1a22461185247b7cc948b171cb26631cb.tar.gz
math-server-0a59c0d1a22461185247b7cc948b171cb26631cb.zip
Docker: install using CMake
-rw-r--r--client/Dockerfile18
-rw-r--r--server/Dockerfile15
2 files changed, 17 insertions, 16 deletions
diff --git a/client/Dockerfile b/client/Dockerfile
index a2408cf..ed5762f 100644
--- a/client/Dockerfile
+++ b/client/Dockerfile
@@ -20,13 +20,13 @@ COPY [".", "/tmp/src/"]
WORKDIR /tmp/build
-RUN cmake -G "Unix Makefiles" \
- -D CMAKE_BUILD_TYPE=RelWithDebInfo \
- -D ENABLE_TESTS=ON \
- /tmp/src && \
- cmake --build test && \
- ./test/unit_tests/unit_tests --log_level=all && \
- cmake --build client
-
-ENTRYPOINT ["./client/client"]
+RUN cmake -G "Unix Makefiles" \
+ -D CMAKE_BUILD_TYPE=Release \
+ -D CMAKE_INSTALL_PREFIX=/usr/local \
+ -D ENABLE_TESTS=ON \
+ /tmp/src && \
+ cmake --build . --config Release --target install && \
+ /usr/local/bin/unit_tests --log_level=all
+
+ENTRYPOINT ["/usr/local/bin/client"]
CMD ["-c", "2 * 2"]
diff --git a/server/Dockerfile b/server/Dockerfile
index cf95119..599b81f 100644
--- a/server/Dockerfile
+++ b/server/Dockerfile
@@ -20,12 +20,13 @@ COPY [".", "/tmp/src/"]
WORKDIR /tmp/build
-RUN cmake -G "Unix Makefiles" \
- -D CMAKE_BUILD_TYPE=Release \
- -D ENABLE_TESTS=ON \
- /tmp/src && \
- cmake --build test && \
- ./test/unit_tests/unit_tests --log_level=all && \
+RUN cmake -G "Unix Makefiles" \
+ -D CMAKE_BUILD_TYPE=Release \
+ -D CMAKE_INSTALL_PREFIX=/usr/local \
+ -D ENABLE_TESTS=ON \
+ /tmp/src && \
+ cmake --build . --config Release --target install && \
+ /usr/local/bin/unit_tests --log_level=all
cmake --build server
-CMD ["./server/main/server"]
+CMD ["/usr/local/bin/server"]