Skip to content

Commit b3002fe

Browse files
committed
docker
1 parent 32a640f commit b3002fe

File tree

2 files changed

+68
-5
lines changed

2 files changed

+68
-5
lines changed

Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM ubuntu
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
RUN apt-get update && apt-get install -y postgresql python3 python3-pip wget unzip sudo
5+
6+
USER postgres
7+
RUN /etc/init.d/postgresql start && \
8+
createuser proxy_py && \
9+
createdb proxy_py && \
10+
psql -c "alter user proxy_py with encrypted password 'proxy_py';" && \
11+
psql -c "grant all privileges on database proxy_py to proxy_py;" && \
12+
cat /etc/postgresql/10/main/pg_hba.conf | \
13+
sed -e "s/local all all peer/local all all md5/" | \
14+
tee /etc/postgresql/10/main/pg_hba.conf && \
15+
/etc/init.d/postgresql stop
16+
USER root
17+
# psql --command "CREATE USER proxy_py WITH SUPERUSER PASSWORD 'proxy_py';" && \
18+
# createdb -O docker docker
19+
20+
# RUN su postgres -c '/etc/init.d/postgresql start'
21+
# RUN su postgres -c 'createuser proxy_py'
22+
# RUN su postgres -c 'createdb proxy_py'
23+
# RUN su postgres -c 'psql -c "alter user proxy_py with encrypted password \'proxy_py\';"'
24+
# RUN su postgres -c 'psql -c "grant all privileges on database proxy_py to proxy_py;"'
25+
# RUN /etc/init.d/postgresql restart
26+
RUN ls /
27+
RUN wget https://github.com/DevAlone/proxy_py/archive/master.zip 2> /dev/null
28+
RUN unzip master.zip
29+
RUN rm master.zip
30+
RUN mv proxy_py-master proxy_py
31+
RUN cd proxy_py
32+
WORKDIR proxy_py
33+
RUN pip3 install -r requirements.txt
34+
RUN cp config_examples/settings.py /proxy_py/proxy_py/
35+
36+
EXPOSE 55555
37+
CMD /etc/init.d/postgresql start; python3 main.py

README.rst

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,39 @@ How to build?
4646
I'm too lazy. Can I just use it?
4747
********************************
4848

49-
`TODO: update, old version!`
49+
Yep, here is a prepared docker image
5050

51-
Yep, you can download virtualbox image
52-
here -> https://drive.google.com/file/d/1oPf6xwOADRH95oZW0vkPr1Uu_iLDe9jc/view?usp=sharing
51+
1 Install docker. If you're using ubuntu:
5352

54-
After downloading check that port forwarding is still working,
55-
you need forwarding of 55555 host port to 55555 guest.
53+
.. code-block:: bash
54+
55+
sudo apt install docker.io
56+
57+
2 Create container
58+
59+
.. code-block:: bash
60+
61+
docker create -p 55555:55555 --name proxy_py proxypy/proxy_py:v2.1
62+
63+
3 Run
64+
65+
.. code-block::
66+
67+
docker container start proxy_py
68+
69+
It will give you a server on address localhost:55555
70+
71+
To see running containers use
72+
73+
.. code-block:: bash
74+
75+
docker ps
76+
77+
To stop proxy_py use
78+
79+
.. code-block:: bash
80+
81+
docker stop proxy_py
5682
5783
How to get proxies?
5884
*******************

0 commit comments

Comments
 (0)