diff --git a/.gitignore b/.gitignore index baa1cc0..fde5cbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ my_account.txt +tg-bot-api.env diff --git a/Dockerfile b/Dockerfile index 423953f..0368c23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,11 +6,14 @@ RUN apk add --no-cache openssl-dev linux-headers zlib-dev gcc gperf cmake build- && cd build \ && cmake -DCMAKE_BUILD_TYPE=Release .. \ && cmake --build . --target install \ - && apk del linux-headers gcc gperf cmake build-base git -RUN adduser --no-create-home --uid 2000 --disabled-password tg-bot + && apk del linux-headers gcc gperf cmake build-base git \ + && rm -r ./telegram-bot-api +RUN adduser --no-create-home --uid 2000 --disabled-password tg-bot \ + && mkdir -p /opt/telegram-bot-api \ + && chown tg-bot:tg-bot /opt/telegram-bot-api ENV TELEGRAM_API_ID="" ENV TELEGRAM_API_HASH="" EXPOSE 8081/tcp USER tg-bot -ENTRYPOINT ["/usr/local/bin/telegram-bot-api", "--local"] \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/telegram-bot-api", "--local", "--dir=/opt/telegram-bot-api"] \ No newline at end of file diff --git a/build.sh b/build.sh index bfbb5b9..9c0aa4c 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,4 @@ #!/bin/bash docker build -t bearns.me/tg-api . -docker run --name tg-api bearns.me/tg-api +docker container rm tg-api +docker run --name tg-api --env=./tg-bot-api.env bearns.me/tg-api diff --git a/tg-bot-api.env b/tg-bot-api.env new file mode 100644 index 0000000..426317f --- /dev/null +++ b/tg-bot-api.env @@ -0,0 +1,2 @@ +TELEGRAM_API_ID= +TELEGRAM_API_HASH= \ No newline at end of file