-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (53 loc) · 1.92 KB
/
Dockerfile
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# The FROM instruction sets the Base Image for subsequent instructions.
FROM centos:6
MAINTAINER Nick <[email protected]>
#配置基础安装环境
RUN yum -y groupinstall "Development tools"
RUN yum -y install zlib-devel
RUN yum -y install bzip2-devel
RUN yum -y install openssl-devel
RUN yum -y install ncurses-devel
RUN yum -y install sqlite-devel
RUN yum -y install wget
#配置python
WORKDIR /opt
RUN wget --no-check-certificate https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
RUN tar xf Python-2.7.9.tar.xz
WORKDIR Python-2.7.9
RUN ./configure --prefix=/usr/local
RUN make && make altinstall
RUN ln -s /usr/local/bin/python2.7 /usr/local/bin/python
#配置pip
WORKDIR /usr/local/src
RUN wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate
RUN wget http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz
RUN tar zxvf setuptools-2.0.tar.gz
WORKDIR setuptools-2.0
RUN python setup.py build
RUN python setup.py install
WORKDIR /usr/local/src
RUN tar -xzvf pip-1.5.4.tar.gz
WORKDIR pip-1.5.4
RUN python setup.py install
#配置mysql
RUN yum install -y mysql-server mysql mysql-devel
#配置mysqldb
RUN pip install mysql-python==1.2.3
#配置request
RUN pip install requests==2.12.0
#配置sqlalchemy
RUN pip install sqlalchemy==1.1.0
#配置tornado
RUN pip install tornado==4.0
#配置redis
RUN pip install redis==2.10.5
#配置qiniu
RUN pip install qiniu
#创建一个指定的文件夹用于放置代码
RUN mkdir -p /app
WORKDIR /app
COPY . /app
# The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime
EXPOSE 800
# The CMD instruction provides default execution command for an container
# Start Nginx and keep it from running background