1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00
dockerfiles/proxyhub/Dockerfile
Pratik raj b113da5d19 chore: Use --no-cache-dir flag to pip in Dockerfiles, to save space
Using "--no-cache-dir" flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2021-07-02 01:02:49 +05:30

45 lines
1.2 KiB
Docker

#
# Dockerfile for ProxyHub
#
FROM ubuntu:14.04
MAINTAINER kev <noreply@easypi.pro>
RUN apt-get update
RUN apt-get install -y build-essential pdnsd haproxy polipo nginx python
RUN apt-get clean
ADD ./haproxy.cfg /etc/haproxy/
ADD ./pdnsd.conf /etc/
ADD ./polipo.conf /etc/polipo/config
ADD ./shadowsocks.json /etc/
ADD ./supervisord.conf /etc/supervisor/
ADD ./services.ini /etc/supervisor/conf.d/
ADD http://stedolan.github.io/jq/download/linux64/jq /usr/local/bin/
ADD https://bootstrap.pypa.io/get-pip.py /tmp/pkgs/
ADD https://download.libsodium.org/libsodium/releases/libsodium-1.0.2.tar.gz /tmp/pkgs/
ADD http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.4.3.tar.gz /tmp/pkgs/
WORKDIR /tmp/pkgs/
RUN chmod +x /usr/local/bin/jq
RUN python get-pip.py
RUN pip install --no-cache-dir supervisor shadowsocks
RUN tar xzf libsodium-1.0.2.tar.gz && \
cd libsodium-1.0.2 && \
./configure && \
make && \
make install
RUN echo /usr/local/lib > /etc/ld.so.conf.d/local.conf && ldconfig
RUN tar xzf dnscrypt-proxy-1.4.3.tar.gz && \
cd dnscrypt-proxy-1.4.3 && \
./configure && \
make && \
make install
WORKDIR /
RUN rm -r /tmp/pkgs/
EXPOSE 53/udp 53/tcp 80 1080 8123 9001
CMD supervisord -n -c /etc/supervisor/supervisord.conf