从 Dockerfile
打包和构建服务所需的image.
- 安装依赖包。
- 更换国内源。
- pip安装requirements。
- 卸载依赖包。
FROM registry.docker-cn.com/library/alpine:3.5
COPY . /target-dir
WORKDIR /target-dir
RUN sed -i 's/dl-cdn.alpinelinux.org/mirror.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
apk add --no-cache python3 && \
apk add --no-cache --virtual=build-dependencies \
mariadb-dev\
g++ \
build-base libffi-dev python3-dev \
libffi openssl ca-certificates \
jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
linux-headers pcre-dev && \
pip3 install --upgrade pip --no-cache-dir -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com &&\
pip3 install --no-cache-dir -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r /target-dir/requirements.txt && \
apk del g++ mariadb-dev && \
apk add --no-cache mariadb-client-libs && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache \
/tmp/*
requirements.txt
appnope==0.1.0
asgiref==1.1.2
attrs==17.2.0
autobahn==17.9.2
Automat==0.6.0
certifi==2017.7.27.1
channels==1.1.8
chardet==3.0.4
constantly==15.1.0
crcmod==1.7
daphne==1.3.0
decorator==4.1.2
Django==1.11.6
django-aliyun-oss2-storage==0.1.5
django-webpack-loader==0.5.0
djangorestframework==3.6.4
hyperlink==17.3.1
idna==2.6
incremental==17.5.0
ipython==6.2.1
ipython-genutils==0.2.0
jedi==0.11.0
olefile==0.44
oss2==2.3.4
parso==0.1.0
pexpect==4.2.1
pickleshare==0.7.4
Pillow==5.0.0
prompt-toolkit==1.0.15
ptyprocess==0.5.2
Pygments==2.2.0
mysqlclient==1.3.12
pytz==2017.2
redis==2.10.6
requests==2.18.4
simplegeneric==0.8.1
six==1.11.0
traitlets==4.3.2
Twisted==17.5.0
txaio==2.8.2
typing==3.6.2
urllib3==1.22
uWSGI==2.0.16
wcwidth==0.1.7
zope.interface==4.4.3