Skip to content

Commit

Permalink
fix:利用docker缓存加速构建
Browse files Browse the repository at this point in the history
  • Loading branch information
Renzhi committed Dec 20, 2019
1 parent 663b073 commit 9c39e3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
**/*~
**/.DS_Store
**/Thumbs.db
*.png
.idea/
.git/
.github/
*.md
UnitTest/
uml/
6 changes: 4 additions & 2 deletions Dockerfile37
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ echo 'deb http://mirrors.163.com/debian-security/ jessie/updates main non-free c

RUN apt-get -y update

ADD . /usr/src/app
WORKDIR /usr/src/app

RUN wget -c https://dl.lancdn.com/landian/soft/chrome/m/77.0.3865.120_amd64.deb && \
Expand All @@ -28,11 +27,14 @@ unzip chromedriver_linux64.zip
ENV DEBIAN_FRONTEND noninteractive
ENV TZ Asia/Shanghai

COPY requirements.txt /usr/src/app/

## install python requirements
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider --no-cache-dir -r requirements.txt
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY . /usr/src/app

## install ntpdate, not accept but saving code
#RUN echo 'deb http://mirrors.163.com/debian/ jessie main non-free contrib \
# deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib \
Expand All @@ -43,5 +45,5 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#EXPOSE 5010

CMD [ "python", "run.py" ]
CMD [ "python", "run.py", "r" ]
#ENTRYPOINT [ "python", "run.py" ]

0 comments on commit 9c39e3d

Please sign in to comment.