Skip to content

Commit 9c39e3d

Browse files
author
Renzhi
committed
fix:利用docker缓存加速构建
1 parent 663b073 commit 9c39e3d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
**/*~
66
**/.DS_Store
77
**/Thumbs.db
8+
*.png
89
.idea/
910
.git/
11+
.github/
12+
*.md
13+
UnitTest/
14+
uml/

Dockerfile37

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ echo 'deb http://mirrors.163.com/debian-security/ jessie/updates main non-free c
99

1010
RUN apt-get -y update
1111

12-
ADD . /usr/src/app
1312
WORKDIR /usr/src/app
1413

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

30+
COPY requirements.txt /usr/src/app/
3131

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

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

4446
#EXPOSE 5010
4547

46-
CMD [ "python", "run.py" ]
48+
CMD [ "python", "run.py", "r" ]
4749
#ENTRYPOINT [ "python", "run.py" ]

0 commit comments

Comments
 (0)