mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-21 13:48:19 +00:00
36 lines
1.7 KiB
Docker
36 lines
1.7 KiB
Docker
FROM python:3.12-bookworm
|
|
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"]
|
|
WORKDIR /app
|
|
RUN echo "deb http://ftp.us.debian.org/debian bookworm main non-free" >> /etc/apt/sources.list.d/fonts.list \
|
|
&& apt update \
|
|
# clone
|
|
&& apt install git wget curl ffmpeg -y \
|
|
&& git clone -b sr --recursive https://github.com/PaiGramTeam/PamGram.git /app \
|
|
# install dependencies \
|
|
&& pip install virtualenv \
|
|
&& python3 -m virtualenv venv/ \
|
|
&& . venv/bin/activate \
|
|
&& pip install -r requirements.txt \
|
|
&& playwright install chromium \
|
|
&& playwright install-deps chromium \
|
|
## set timezone
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
|
# create cache folder
|
|
&& mkdir cache/ \
|
|
# clean
|
|
&& apt-get clean -y \
|
|
&& rm -rf \
|
|
/tmp/* \
|
|
/var/lib/apt/lists/* \
|
|
/var/tmp/* \
|
|
~/.cache/pip \
|
|
~/.cache/pypoetry \
|
|
# Add the wait script to the image
|
|
&& wget -O /wait https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait \
|
|
&& chmod +x /wait
|
|
ENTRYPOINT /wait && venv/bin/alembic upgrade head && venv/bin/python run.py
|