PamGram/Dockerfile

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 \
&& pip install virtualenv \
2022-10-27 12:13:57 +00:00
&& python3 -m virtualenv venv/ \
&& . venv/bin/activate \
&& pip install -r requirements.txt \
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 \
~/.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 \
2023-02-11 05:17:02 +00:00
&& chmod +x /wait
ENTRYPOINT /wait && venv/bin/alembic upgrade head && venv/bin/python run.py