forked from jhao104/proxy_pool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (30 loc) · 1.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM python:2.7
WORKDIR /usr/src/app
COPY . .
ENV DEBIAN_FRONTEND noninteractive
ENV TZ Asia/Shanghai
RUN pip install --no-cache-dir -r requirements.txt && \
apt-get update && \
apt-get install -y --force-yes git make gcc g++ autoconf && apt-get clean && \
git clone --depth 1 https://github.com/ideawu/ssdb.git ssdb && \
cd ssdb && make && make install && cp ssdb-server /usr/bin && \
apt-get remove -y --force-yes git make gcc g++ autoconf && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
cp ssdb.conf /etc && cd .. && yes | rm -r ssdb && \
mkdir -p /var/lib/ssdb && \
sed \
-e 's@home.*@home /var/lib@' \
-e 's/loglevel.*/loglevel info/' \
-e 's@work_dir = .*@work_dir = /var/lib/ssdb@' \
-e 's@pidfile = .*@pidfile = /run/ssdb.pid@' \
-e 's@level:.*@level: info@' \
-e 's@ip:.*@ip: 0.0.0.0@' \
-i /etc/ssdb.conf && \
echo "# ! /bin/sh " > /usr/src/app/run.sh && \
echo "cd Run" >> /usr/src/app/run.sh && \
echo "/usr/bin/ssdb-server /etc/ssdb.conf &" >> /usr/src/app/run.sh && \
echo "python main.py" >> /usr/src/app/run.sh && \
chmod 777 run.sh
EXPOSE 5000
CMD [ "sh", "run.sh" ]