QQ-GitHub-Bot/Dockerfile

26 lines
993 B
Docker
Raw Normal View History

2020-09-17 14:42:41 +00:00
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
RUN python3 -m pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
RUN python3 -m pip install poetry && poetry config virtualenvs.create false
COPY ./pyproject.toml ./poetry.lock* /app/
2021-03-14 04:58:50 +00:00
RUN poetry export --without-hashes -f requirements.txt \
| poetry run pip install -r /dev/stdin \
2021-03-15 12:13:55 +00:00
&& echo "Install playwright headless browser..." \
2021-03-16 09:59:16 +00:00
&& poetry run playwright install \
&& poetry install --no-dev
2021-03-14 04:58:50 +00:00
COPY ./download_wkhtmltox.sh /app/
RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free" >> /etc/apt/sources.list\
&& echo "deb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list\
&& apt-get update
2021-03-15 12:13:55 +00:00
RUN echo "Install wkhtmltox renderer..." \
2021-03-16 10:18:10 +00:00
&& chmod +x ./download_wkhtmltox.sh \
2021-03-15 12:13:55 +00:00
&& ./download_wkhtmltox.sh buster_amd64 \
2021-03-14 04:58:50 +00:00
&& apt-get install -y xvfb ./wkhtmltox_*.deb\
2021-03-15 12:13:55 +00:00
&& rm wkhtmltox_*.deb download_wkhtmltox.sh