2020-09-17 14:42:41 +00:00
|
|
|
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
|
|
|
|
|
2021-04-02 11:35:49 +00:00
|
|
|
ENV LANG zh_CN.UTF-8
|
|
|
|
ENV LANGUAGE zh_CN.UTF-8
|
|
|
|
ENV LC_ALL zh_CN.UTF-8
|
2021-06-19 16:09:19 +00:00
|
|
|
ENV TZ Asia/Shanghai
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
|
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak &&\
|
|
|
|
echo "deb http://mirrors.aliyun.com/debian/ buster main" >> /etc/apt/sources.list\
|
|
|
|
&& echo "deb http://mirrors.aliyun.com/debian/ buster-updates main" >> /etc/apt/sources.list\
|
|
|
|
&& echo "deb http://mirrors.aliyun.com/debian-security/ buster/updates main" >> /etc/apt/sources.list\
|
|
|
|
&& apt-get update && apt-get install -y locales locales-all fonts-noto
|
2021-04-02 11:35:49 +00:00
|
|
|
|
2021-04-02 06:52:07 +00:00
|
|
|
# RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
|
2020-09-17 14:42:41 +00:00
|
|
|
|
|
|
|
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
|
|
|
|
|
2021-05-16 03:11:02 +00:00
|
|
|
COPY ./ /app/
|
2020-09-17 14:42:41 +00:00
|
|
|
|
2021-03-14 04:58:50 +00:00
|
|
|
RUN poetry export --without-hashes -f requirements.txt \
|
2021-06-19 16:09:19 +00:00
|
|
|
| poetry run pip install -r /dev/stdin \
|
|
|
|
&& echo "Install playwright headless browser..." \
|
|
|
|
&& poetry run playwright install chromium \
|
|
|
|
&& apt-get install -y libnss3-dev libxss1 libasound2 libxrandr2\
|
|
|
|
libatk1.0-0 libgtk-3-0 libgbm-dev\
|
|
|
|
&& poetry install --no-dev
|
2021-03-14 04:58:50 +00:00
|
|
|
|
2021-03-15 12:13:55 +00:00
|
|
|
RUN echo "Install wkhtmltox renderer..." \
|
2021-06-19 16:09:19 +00:00
|
|
|
&& chmod +x ./scripts/download_wkhtmltox.sh \
|
|
|
|
&& ./scripts/download_wkhtmltox.sh buster_amd64 \
|
|
|
|
&& apt-get install -y xvfb ./wkhtmltox_*.deb\
|
|
|
|
&& rm wkhtmltox_*.deb
|