Skip to content

Instantly share code, notes, and snippets.

@f14a2cd
Last active February 24, 2020 04:11
Show Gist options
  • Save f14a2cd/82bd036e216ff489626b0220ccceca6a to your computer and use it in GitHub Desktop.
Save f14a2cd/82bd036e216ff489626b0220ccceca6a to your computer and use it in GitHub Desktop.
TelegramApiServer docker
FROM ubuntu:latest AS base
RUN sed -i 's/archive.ub/ru.archive.ub/g' /etc/apt/sources.list
RUN apt-get update && apt install -f -y libssl-dev && apt-get install --assume-yes git
RUN git clone https://github.com/xtrime-ru/TelegramApiServer.git
WORKDIR /TelegramApiServer
FROM composer:latest AS build
COPY --from=base /TelegramApiServer /TelegramApiServer
WORKDIR /TelegramApiServer
RUN composer install -o --no-dev
FROM php:7-alpine AS final
EXPOSE 9503
COPY --from=build /TelegramApiServer .
RUN rm -rf examples/
RUN sed -i 's/TELEGRAM_API_ID=/TELEGRAM_API_ID=21724/g' .env.example
RUN sed -i 's/TELEGRAM_API_HASH=/TELEGRAM_API_HASH=3e0cb5efcd52300aec5994fdfc5bdc16/g' .env.example
RUN sed -i 's/SERVER_ADDRESS=127.0.0.1/SERVER_ADDRESS=0.0.0.0/g' .env.example
# Leave blank, to allow requests from all IP (dangerous!)
RUN sed -i 's/IP_WHITELIST=127.0.0.1/IP_WHITELIST=/g' .env.example
RUN sed -i 's/LOGGER_LEVEL=3/LOGGER_LEVEL=5/g' .env.example
RUN mv .env.example .env
VOLUME ["/TelegramApiServer/sessions"]
ENTRYPOINT ["php", "server.php"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment