diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..38daa6a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,14 @@ +.DS_Store +.ci +.cppcheck +.github +.idea +Dockerfile +docs-md +Readme.md +Doxyfile +.travis.yml +customdoxygen.css +run.sh +get_ssh_keys +.gitignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index cfe4070..039cc06 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ CMakeCache.txt *build_info.h config.h docs +/.idea +id_rsa +id_rsa.pub +/logs \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2a9a13c..8ded055 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,21 @@ FROM debian ENV LANG ru_RU.UTF-8 ENV TZ="Europe/Moscow" - -COPY binaries/btpd /usr/local/bin/ RUN apt update && apt install -y libsnappy1v5 -RUN groupadd -g 80 www \ - && useradd -u 30 --shell /sbin/nologin --group www wwwrun; -USER wwwrun - +RUN apt -y install g++ cmake git wget +RUN groupadd -g 80 www && useradd -u 30 --shell /sbin/nologin --group www wwwrun; +RUN mkdir /bptd +COPY . /btpd/ +RUN mkdir ~/.ssh +RUN chmod 700 ~/.ssh +COPY id_rsa /root/.ssh/ +COPY id_rsa.pub /root/.ssh/ +RUN chmod 600 /root/.ssh/id_rsa +RUN chmod 600 /root/.ssh/id_rsa.pub +RUN ssh-keyscan github.com >> /root/.ssh/known_hosts +RUN cd /btpd && make release +EXPOSE 38001 38001/udp 38000 38000/udp 37000 37001 37002 37003 37004 +WORKDIR /btpd/ +RUN rm /root/.ssh/id_rsa +RUN rm /root/.ssh/id_rsa.pub +CMD ["build/bin/btpd", "-C", "examples/simple/btp.conf"] diff --git a/examples/simple/btp.ini b/examples/simple/btp.ini index 247f555..9f63de0 100644 --- a/examples/simple/btp.ini +++ b/examples/simple/btp.ini @@ -2,7 +2,7 @@ log = logs/btp.log [db] - path=btp/ + path=btp/storage/ # ======================================= [rt-udp] diff --git a/get_ssh_keys b/get_ssh_keys new file mode 100755 index 0000000..8d99329 --- /dev/null +++ b/get_ssh_keys @@ -0,0 +1,3 @@ +#!/bin/bash +cp ~/.ssh/id_rsa . +cp ~/.ssh/id_rsa.pub . \ No newline at end of file