Skip to content

Commit

Permalink
Expose http port via env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
lans committed Aug 19, 2024
1 parent fe5ff3b commit 62b303a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ RUN mkdir -p /telegram-bot-api/build && \
# Main image
FROM alpine:latest
LABEL Maintainer="[email protected]"

ENV API_ID=some_env_id \
API_HASH=some_api_hash \
HTTP_PORT=8081

RUN apk add zlib openssl gperf && \
mkdir -p /telegram-bot-api/files /telegram-bot-api/temp
COPY --from=builder /telegram-bot-api/install/bin/telegram-bot-api /telegram-bot-api/
EXPOSE 8081

ENTRYPOINT [ "sh", "-c", "/telegram-bot-api/telegram-bot-api --api-id $API_ID --api-hash $API_HASH --dir /telegram-bot-api/files --temp-dir /telegram-bot-api/temp" ]
ENTRYPOINT [ "sh", "-c", "/telegram-bot-api/telegram-bot-api --api-id $API_ID --api-hash $API_HASH --dir /telegram-bot-api/files --temp-dir /telegram-bot-api/temp --http-port=$HTTP_PORT " ]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
Environment variables:
* API_ID
* API_HASH
* HTTP_PORT - on this port the bot api will listen for connections

There are many more configuration options, they could be used by creating your own
docker image from this.

Directories and files:
* /telegram-bot-api/files here bot api stores downloaded files and other working data
Expand Down

0 comments on commit 62b303a

Please sign in to comment.