Skip to content

Commit a44c05f

Browse files
committed
add dockerfile
1 parent f52730d commit a44c05f

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Dockerfile by xianhu: build a docker image for spider or flask
2+
# usage: docker build -t user/centos:v06 .
3+
4+
FROM centos:6.8
5+
6+
MAINTAINER xianhu <[email protected]>
7+
8+
# change system environments
9+
ENV LANG en_US.UTF-8
10+
ENV LC_ALL en_US.UTF-8
11+
12+
# change system local time
13+
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
14+
15+
# update yum and install something
16+
RUN yum update -y
17+
RUN yum install -y xz
18+
RUN yum install -y vim
19+
RUN yum install -y git
20+
RUN yum install -y wget
21+
RUN yum install -y crontabs
22+
RUN yum install -y gcc
23+
RUN yum install -y make
24+
RUN yum install -y zlib-devel
25+
RUN yum install -y openssl-devel
26+
RUN yum clean all
27+
28+
# restart crontab service
29+
RUN service crond restart
30+
31+
# download python3
32+
WORKDIR /root/
33+
RUN wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tar.xz
34+
RUN tar -xf Python-3.5.3.tar.xz
35+
36+
# install python3
37+
WORKDIR /root/Python-3.5.3
38+
RUN ./configure
39+
RUN make install
40+
RUN make clean
41+
RUN make distclean
42+
43+
# install libs of python3
44+
ADD ./Dockerfile_requirements.txt /root/
45+
WORKDIR /root/
46+
RUN pip3 install --upgrade pip
47+
RUN pip3 install -r Dockerfile_requirements.txt
48+
RUN rm -rf /root/*
49+
50+
# change python to python3
51+
RUN ln -sf /usr/local/bin/python3 /usr/bin/python
52+
RUN ln -sf /usr/bin/python2.6 /usr/bin/python2
53+
54+
# change /usr/bin/yum
55+
RUN sed -i 's/usr\/bin\/python/usr\/bin\/python2/g' /usr/bin/yum
56+
57+
# cmd command
58+
CMD /bin/bash

Dockerfile_requirements.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
virtualenv
2+
pylint
3+
beautifulsoup4
4+
pybloom_live
5+
requests
6+
aiohttp
7+
html5lib
8+
elasticsearch
9+
PyMySQL
10+
redis
11+
Flask
12+
Flask-Bootstrap
13+
Flask-HTTPAuth
14+
Flask-Login
15+
Flask-Mail
16+
Flask-Migrate
17+
Flask-Moment
18+
Flask-Script
19+
Flask-SQLAlchemy
20+
Flask-WTF
21+
gunicorn
22+
uWSGI

0 commit comments

Comments
 (0)