PamGram/Dockerfile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.7 KiB
Docker
Raw Normal View History

FROM python:3.12-bookworm
2023-02-11 05:17:02 +00:00
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
LANG=zh_CN.UTF-8 \
SHELL=/bin/bash
SHELL ["/bin/bash", "-c"]
2022-10-27 12:13:57 +00:00
WORKDIR /app
RUN echo "deb http://ftp.us.debian.org/debian bookworm main non-free" >> /etc/apt/sources.list.d/fonts.list \
2023-02-11 05:17:02 +00:00
&& apt update \
# clone
2023-04-14 04:16:18 +00:00
&& apt install git wget curl ffmpeg -y \
2023-09-09 15:09:22 +00:00
&& git clone -b sr --recursive https://github.com/PaiGramTeam/PamGram.git /app \
2023-02-11 05:17:02 +00:00
# install dependencies \
2024-11-08 15:55:10 +00:00
&& pip install virtualenv uv \
&& python3 -m uv venv .venv \
&& . .venv/bin/activate \
&& uv sync --all-extras \
2022-10-27 12:13:57 +00:00
&& playwright install chromium \
2023-02-11 05:17:02 +00:00
&& playwright install-deps chromium \
## set timezone
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
# create cache folder
2022-10-27 12:13:57 +00:00
&& mkdir cache/ \
2023-02-11 05:17:02 +00:00
# clean
&& apt-get clean -y \
&& rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/* \
~/.cache/pip \
2024-11-08 15:55:10 +00:00
~/.cache/uv \
2023-02-11 05:17:02 +00:00
# Add the wait script to the image
&& wget -O /wait https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait \
2023-02-11 05:17:02 +00:00
&& chmod +x /wait
2024-11-08 15:55:10 +00:00
ENTRYPOINT /wait && .venv/bin/alembic upgrade head && .venv/bin/python run.py