Pythonマイクロサービス開発でよく使われるDockerテンプレート
913 ワード
FROM ubuntu:18.04
ENV TZ Asia/Shanghai
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
apt-get update && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &&\
apt-get install -y --no-install-recommends tzdata python3.6 python3-dev python3-tk \
python3-pip python3-setuptools ffmpeg openjdk-8-jdk-headless libsm6 libglib2.0-0
COPY ./requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r /tmp/requirements.txt
COPY . /home/dolphin
WORKDIR /home/dolphin
ENV LANG C.UTF-8
ENV PYTHONIOENCODING utf-8
CMD gunicorn -b 0.0.0.0:8010 -w 2 flask_app:app --access-logfile - & python3 process_server.py
pip共通ミラーソース:
https://pypi.tuna.tsinghua.edu.cn/simple
https://mirrors.aliyun.com/pypi/simple/