Commit 9192d7ee authored by Denis's avatar Denis
Browse files

add docker

4 merge requests!24MVP+,!18RK: MVP,!12Serv+metr+repo,!11Service+metrics
Showing with 71 additions and 34 deletions
+71 -34
/cmake-build-debug/
/build/
/build1/
.vscode
.idea
CMakeUserPresets.json
\ No newline at end of file
FROM ubuntu:20.04 AS base FROM ubuntu:20.04 AS base
ENV TZ=Europe/Moscow ENV TZ=Europe/Moscow
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update -y RUN apt update -y
RUN apt install -y gcc RUN apt install -y gcc
RUN apt install -y libpqxx-dev RUN apt install -y libpqxx-dev
RUN apt install -y clang-tidy RUN apt install -y clang-tidy
RUN apt install -y nlohmann-json3-dev RUN apt install -y python3-pip
RUN apt install -y python3-pip RUN apt install -y cppcheck
RUN apt install -y cppcheck RUN apt-get update
RUN apt install -y git RUN apt install -y cmake
RUN apt-get update -y RUN apt-get update
RUN apt install -y xvfb RUN apt install -y libboost-all-dev
RUN pip install gcovr RUN apt install -y nlohmann-json3-dev
RUN pip install cpplint RUN apt install -y git
RUN apt install -y qt5-default
RUN apt-get update
RUN apt install -y default-jre
RUN apt -y install curl
RUN pwd
WORKDIR /usr/local/lib
RUN curl -O https://www.antlr.org/download/antlr-4.12.0-complete.jar
RUN apt install -y xvfb
RUN pip install gcovr
RUN pip install cpplint
RUN apt-get install wget
RUN apt-get install libssl-dev
RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz
RUN tar -zxvf cmake-3.26.3.tar.gz
WORKDIR cmake-3.26.3
RUN ./bootstrap
RUN make
RUN make install
RUN cd ..
RUN wget https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz
RUN tar xvf boost_1_82_0.tar.gz
WORKDIR boost_1_82_0
RUN ./bootstrap.sh --prefix=/usr/
RUN ./b2 install
RUN git clone https://github.com/google/googletest.git -b release-1.11.0 RUN git clone https://github.com/google/googletest.git -b release-1.11.0
WORKDIR googletest/build WORKDIR googletest/build
RUN cmake .. -DBUILD_GMOCK=OFF RUN cmake .. -DBUILD_GMOCK=ON
RUN make RUN make
RUN make install RUN make install
WORKDIR /project WORKDIR /project
COPY . . COPY . .
\ No newline at end of file
EXPOSE 8080
\ No newline at end of file
Makefile 0 → 100644
generate:
mkdir build
cmake -B build/
build-project:
cd ./build && make
clean:
rm -rf build
rebuild: clean generate build-project
server-run:
./build/server/cmd/Server
test:
ctest --verbose --output-on-failure --test-dir build/
build-docker:
docker build . -f Dockerfile -t ddt-project
dev:
docker run --rm -it \
-v $(PWD):/project \
--name app \
ddt-project
stop-docker:
docker stop app
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
int main(int argc, const char* argv[]) { int main(int argc, const char* argv[]) {
// ifstream ins("/home/denis/2023_1_DDT/antlr/test.py"); // ifstream ins("/home/denis/2023_1_DDT/antlr/test.py");
std::ifstream ins("/home/denis/2023_1_DDT/server/pkg/antlr/testprogs/python/test.py"); std::ifstream ins(
"/home/denis/2023_1_DDT/server/pkg/antlr/testprogs/python/test.py");
PythonAntlr pA = PythonAntlr(ins); PythonAntlr pA = PythonAntlr(ins);
...@@ -16,6 +17,7 @@ int main(int argc, const char* argv[]) { ...@@ -16,6 +17,7 @@ int main(int argc, const char* argv[]) {
} }
std::cout << pA.getTreeString() << std::endl; std::cout << pA.getTreeString() << std::endl;
std::cout << "test" << std::endl;
return 0; return 0;
} }
\ No newline at end of file
cmake_minimum_required(VERSION 3.19)
project("EntitiesLib") project("EntitiesLib")
set(LIB_NAME libEntities) set(LIB_NAME libEntities)
......
...@@ -10,6 +10,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) ...@@ -10,6 +10,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
include(ExternalAntlr4Cpp) include(ExternalAntlr4Cpp)
include_directories(${ANTLR4_INCLUDE_DIRS}) include_directories(${ANTLR4_INCLUDE_DIRS})
set(ANTLR_EXECUTABLE /usr/local/lib/antlr-4.12.0-complete.jar) set(ANTLR_EXECUTABLE /usr/local/lib/antlr-4.12.0-complete.jar)
find_package(ANTLR REQUIRED) find_package(ANTLR REQUIRED)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment