File size: 879 Bytes
3bb50f7 109d1e8 3bb50f7 dfdee8c 50a0695 56b0b9b 3bb50f7 56b0b9b dfdee8c |
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 |
FROM ubuntu:latest
RUN apt-get update && apt-get install -y \
curl \
netcat-traditional \
&& rm -rf /var/lib/apt/lists/*
RUN --mount=type=secret,id=URL,mode=0444,required=true \
--mount=type=secret,id=FILE_NAME,mode=0444,required=true \
mkdir /bot-data && \
curl -L -o /bot-data/$(cat /run/secrets/FILE_NAME) $(cat /run/secrets/URL)
RUN chmod +x /bot-data/telegram-bot-api
WORKDIR /bot-data
RUN chmod 777 /bot-data
RUN echo 'while true; do { echo -e "HTTP/1.1 200 OK\n\nHello World!" | nc -l -p 7860; } done' > /bot-data/hello-world.sh
RUN chmod +x /bot-data/hello-world.sh
EXPOSE 7860 8081
RUN --mount=type=secret,id=ApiID,mode=0444,required=true \
--mount=type=secret,id=ApiHash,mode=0444,required=true
CMD ./telegram-bot-api --verbosity=0 --local --api-id=$ApiID --api-hash=$ApiHash --temp-dir=/bot-data --dir=/bot-data & ./hello-world.sh |