forked from OpenWaterAnalytics/epanet-rtx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
epanet-rtx.docker
67 lines (54 loc) · 2.27 KB
/
epanet-rtx.docker
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libsqlite3-dev cmake unixodbc-dev libcpprest-dev \
libboost-dev libboost-iostreams-dev gcc g++ make git zlib1g-dev \
openssl curl nlohmann-json3-dev libcurl4-openssl-dev
ENV VIRTUAL_ENV=/opt/venv
RUN apt-get install -y python3-venv \
&& python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip3 install conan \
&& conan profile detect \
&& conan profile show -pr default
WORKDIR /opt/src
## build/install EPANET
# RUN git clone --depth=1 https://github.com/cameron-devine/EPANET.git \
# && sed -i '844s/,EN_Project/,void*/g' ./src/epanet.c \
# && sed -i '520s/EN_Project,/void*,/g' ./include/epanet2_2.h \
# && sed -i '636s/EN_Project/void*/g' ./src/types.h \
RUN git clone --depth=1 https://github.com/OpenWaterAnalytics/EPANET.git \
&& cd EPANET \
&& mkdir build && cd build \
&& cmake .. \
&& cmake --build . --config Release \
&& cp lib/* /usr/local/lib/ \
&& cp ../include/*.h /usr/local/include/ \
&& cp ../src/*.h /usr/local/include/
# RUN git clone --depth=1 https://github.com/OpenWaterAnalytics/epanet-rtx.git \
RUN git clone --depth=1 https://github.com/0tkl/epanet-rtx.git -b dev --single-branch \
&& cd epanet-rtx/deps \
&& conan create local_export/sqlite_modern_cpp_conan.py \
&& conan install . --build=missing -of conan_build/
RUN cp -r EPANET epanet-rtx \
&& cd epanet-rtx/build/cmake \
&& cmake -B . \
-DCMAKE_TOOLCHAIN_FILE=../../deps/conan_build/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
&& cmake --build . --config Release \
&& make install \
&& ./bin/epanetrtx-test
RUN git clone https://github.com/srinivasrk/epanet-rtx-link.git rtx_link \
&& cd rtx_link \
&& cp ./build/templates/odbcinst.ini.template /etc/odbcinst.ini \
&& cp -r ./frontend /usr/app \
&& mkdir -p /usr/app/srv/linux \
&& cp /usr/local/bin/link-server /usr/app/srv/linux/link-server
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y --no-install-recommends nodejs tdsodbc
WORKDIR /usr/app
RUN npm install --no-audit \
&& NODE_OPTIONS=--openssl-legacy-provider npm run build
EXPOSE 3000
VOLUME /root/rtx_link
CMD [ "npm", "start" ]