forked from jhao104/proxy_pool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (21 loc) · 809 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (21 loc) · 809 Bytes
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
FROM python:3.6
WORKDIR /usr/src/app
COPY . .
ENV DEBIAN_FRONTEND noninteractive
ENV TZ Asia/Shanghai
RUN apt-get update
RUN apt-get install vim -y
RUN apt-get install -y redis-server
RUN sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf \
&& sed -i 's/^\(databases .*\)$/databases 1/' /etc/redis/redis.conf \
&& sed -i 's/^\(daemonize .*\)$/daemonize yes/' /etc/redis/redis.conf
# && sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf \
# && sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
RUN pip install --no-cache-dir -r requirements.txt
RUN echo "# ! /bin/sh " > run.sh \
&& echo "redis-server /etc/redis/redis.conf&" >> run.sh \
&& echo "cd Run" >> run.sh \
&& echo "python main.py" >> run.sh \
&& chmod 777 run.sh
EXPOSE 5010
CMD [ "sh", "run.sh" ]