1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 18:06:36 +02:00

add mtproxy

This commit is contained in:
kev 2019-04-15 16:01:05 +08:00
parent 0a017b0707
commit a07632a040
5 changed files with 108 additions and 0 deletions

View File

@ -203,6 +203,7 @@ A collection of delicious docker recipes.
- [x] hans
- [x] haproxy-arm
- [x] kcptun :cn:
- [x] mtproxy
- [x] mysql-proxy
- [x] ngrok :+1:
- [x] obfsproxy

45
mtproxy/Dockerfile Normal file
View File

@ -0,0 +1,45 @@
#
# Dockerfile for mtproxy
#
FROM debian:stretch
MAINTAINER EasyPi Software Foundation
WORKDIR /usr/local/src/mtproxy
RUN set -xe \
&& apt update \
&& apt install -y build-essential curl git libssl-dev zlib1g-dev \
&& git clone --single-branch --depth 1 https://github.com/TelegramMessenger/MTProxy.git . \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& cp ./objs/bin/mtproto-proxy /usr/local/bin/ \
&& apt remove -y build-essential git libssl-dev zlib1g-dev \
&& cd .. \
&& rm -r mtproxy /var/lib/apt/lists/*
WORKDIR /etc/mtproxy
RUN set -xe \
&& curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \
&& curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf
VOLUME /etc/mtproxy
ENV MTP_SECRET 00000000000000000000000000000000
ENV MTP_SLAVES 1
EXPOSE 443 8888
CMD set -xe \
&& curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \
&& curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf \
&& mtproto-proxy --allow-skip-dh \
--user root \
--address 0.0.0.0 \
--port 8888 \
--http-ports 443 \
--slaves $MTP_SLAVES \
--mtproto-secret $MTP_SECRET \
--aes-pwd proxy-secret \
proxy-multi.conf

47
mtproxy/Dockerfile.alpine Normal file
View File

@ -0,0 +1,47 @@
#
# Dockerfile for mtproxy
#
FROM alpine
MAINTAINER EasyPi Software Foundation
WORKDIR /usr/local/src/mtproxy
RUN set -xe \
&& apk add --no-cache curl gcc git linux-headers make musl-dev openssl-dev zlib-dev \
&& git clone --single-branch --depth 1 https://github.com/TelegramMessenger/MTProxy.git . \
&& curl -sSL https://github.com/alexdoesh/mtproxy/raw/master/patches/randr_compat.patch > randr_compat.patch \
&& patch -p0 -i randr_compat.patch \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& cp ./objs/bin/mtproto-proxy /usr/local/bin/ \
&& cd .. \
&& rm -r mtproxy \
&& apk del gcc git linux-headers make musl-dev openssl-dev zlib-dev
WORKDIR /etc/mtproxy
RUN set -xe \
&& ln -s /usr/lib/libcrypto.so.42 /usr/lib/libcrypto.so.1.0.0 \
&& curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \
&& curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf
VOLUME /etc/mtproxy
ENV MTP_SECRET 00000000000000000000000000000000
ENV MTP_SLAVES 1
EXPOSE 443 8888
CMD set -xe \
&& curl -sSL https://core.telegram.org/getProxySecret > proxy-secret \
&& curl -sSL https://core.telegram.org/getProxyConfig > proxy-multi.conf \
&& mtproto-proxy --allow-skip-dh \
--user root \
--address 0.0.0.0 \
--port 8888 \
--http-ports 443 \
--slaves $MTP_SLAVES \
--mtproto-secret $MTP_SECRET \
--aes-pwd proxy-secret \
proxy-multi.conf

4
mtproxy/README.md Normal file
View File

@ -0,0 +1,4 @@
mtproxy
=======
[1]: https://github.com/TelegramMessenger/MTProxy

View File

@ -0,0 +1,11 @@
mtproxy:
image: vimagick/mtproxy
ports:
- "8443:443"
- "8888:8888"
volumes:
- ./data:/etc/mtproxy
environment:
- MTP_SECRET=092b4a4da9855f7923c7dc032157ff53
- MTP_SLAVES=4
restart: unless-stopped