34 lines
938 B
Docker
34 lines
938 B
Docker
|
|
FROM debian:bookworm-slim AS builder
|
||
|
|
|
||
|
|
RUN apt-get update && apt-get install -y \
|
||
|
|
git curl build-essential libssl-dev zlib1g-dev \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
RUN git clone https://github.com/TelegramMessenger/MTProxy.git /src
|
||
|
|
WORKDIR /src
|
||
|
|
RUN make -j$(nproc)
|
||
|
|
|
||
|
|
FROM debian:bookworm-slim
|
||
|
|
|
||
|
|
ENV PROXY_PORT=443
|
||
|
|
ENV STATS_PORT=8888
|
||
|
|
ENV WORKERS=1
|
||
|
|
ENV RUN_USER=nobody
|
||
|
|
|
||
|
|
RUN apt-get update && apt-get install -y \
|
||
|
|
curl libssl3 zlib1g xxd \
|
||
|
|
&& rm -rf /var/lib/apt/lists/*
|
||
|
|
|
||
|
|
COPY --from=builder /src/objs/bin/mtproto-proxy /usr/local/bin/mtproto-proxy
|
||
|
|
|
||
|
|
RUN curl -s https://core.telegram.org/getProxySecret -o /etc/mtproxy/proxy-secret --create-dirs && \
|
||
|
|
curl -s https://core.telegram.org/getProxyConfig -o /etc/mtproxy/proxy-multi.conf
|
||
|
|
|
||
|
|
ENTRYPOINT mtproto-proxy \
|
||
|
|
-u ${RUN_USER} \
|
||
|
|
-p ${STATS_PORT} \
|
||
|
|
-H ${PROXY_PORT} \
|
||
|
|
-M ${WORKERS} \
|
||
|
|
--aes-pwd /etc/mtproxy/proxy-secret \
|
||
|
|
/etc/mtproxy/proxy-multi.conf
|