Dockerfile 809 B

123456789101112131415161718192021222324252627
  1. FROM python:3.6
  2. WORKDIR /usr/src/app
  3. COPY . .
  4. ENV DEBIAN_FRONTEND noninteractive
  5. ENV TZ Asia/Shanghai
  6. RUN apt-get update
  7. RUN apt-get install vim -y
  8. RUN apt-get install -y redis-server
  9. RUN sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf \
  10. && sed -i 's/^\(databases .*\)$/databases 1/' /etc/redis/redis.conf \
  11. && sed -i 's/^\(daemonize .*\)$/daemonize yes/' /etc/redis/redis.conf
  12. # && sed -i 's/^\(dir .*\)$/# \1\ndir \/data/' /etc/redis/redis.conf \
  13. # && sed -i 's/^\(logfile .*\)$/# \1/' /etc/redis/redis.conf
  14. RUN pip install --no-cache-dir -r requirements.txt
  15. RUN echo "# ! /bin/sh " > run.sh \
  16. && echo "redis-server /etc/redis/redis.conf&" >> run.sh \
  17. && echo "cd Run" >> run.sh \
  18. && echo "python main.py" >> run.sh \
  19. && chmod 777 run.sh
  20. EXPOSE 5010
  21. CMD [ "sh", "run.sh" ]