Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ellermister committed Jul 18, 2022
1 parent 7d6f74d commit 4722398
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx
FROM --platform=$TARGETPLATFORM nginx AS build

COPY . /home/mtproxy

Expand All @@ -14,26 +14,23 @@ RUN set -ex \
&& rm -rf .git \
&& cp mtproxy-entrypoint.sh /docker-entrypoint.d/40-mtproxy-start.sh \
&& chmod +x /docker-entrypoint.d/40-mtproxy-start.sh \
&& /bin/cp -f nginx/default.conf /etc/nginx/conf.d/default.conf \
&& /bin/cp -f nginx/ip_white.conf /etc/nginx/ip_white.conf \
&& /bin/cp -f nginx/nginx.conf /etc/nginx/nginx.conf
&& cp -f nginx/default.conf /etc/nginx/conf.d/default.conf \
&& cp -f nginx/ip_white.conf /etc/nginx/ip_white.conf \
&& cp -f nginx/nginx.conf /etc/nginx/nginx.conf

# build mtproxy and install php
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends git curl build-essential libssl-dev zlib1g-dev iproute2 php7.4-fpm vim-common \
&& git clone https://github.com/TelegramMessenger/MTProxy \
&& cd MTProxy \
&& sed -i 's/CFLAGS\s*=[^\r]\+/& -fcommon\r/' Makefile \
&& apt-get install -y --no-install-recommends git wget curl build-essential libssl-dev zlib1g-dev iproute2 php7.4-fpm vim-common \
&& bash mtproxy.sh build \
&& sed -i 's/^user\s*=[^\r]\+/user = root/' /etc/php/7.4/fpm/pool.d/www.conf \
&& sed -i 's/^group\s*=[^\r]\+/group = root/' /etc/php/7.4/fpm/pool.d/www.conf \
&& make && cd objs/bin && cp -f mtproto-proxy $WORKDIR \
&& rm -rf $WORKDIR/MTProxy \
&& rm -rf ~/go \
&& mkdir /run/php -p && mkdir $WORKDIR/pid \
&& apt-get purge -y git build-essential libssl-dev zlib1g-dev \
&& apt-get clean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/*

EXPOSE 80
EXPOSE 443
EXPOSE 80 443

0 comments on commit 4722398

Please sign in to comment.