FROM ubuntu:20.04 RUN apt update && apt install -y python3-pip fonts-noto-cjk fonts-noto-color-emoji git fontconfig RUN git clone https://github.com/MeetWq/meme-generator.git && mkdir /usr/share/fonts/meme && mv meme-generator/resources/fonts/* /usr/share/fonts/meme RUN fc-cache -fv RUN rm -rf meme-generator RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app COPY --chown=user . $HOME/app RUN git clone https://github.com/MeetWq/meme-generator.git ENV POETRY_CONFIG_DIR=$HOME/app/.poetry_config RUN pip install poetry RUN git clone https://github.com/MeetWq/meme-generator-contrib && mkdir $HOME/meme-extend && mv meme-generator-contrib/memes/* $HOME/meme-extend ADD config.toml $HOME/.config/meme_generator/config.toml RUN cd meme-generator && poetry config virtualenvs.in-project true && poetry install && . .venv/bin/activate && python3 -m meme_generator.download && cd .. RUN rm -rf meme-generator-contrib && rm -rf $HOME/meme-generator ADD utils.py meme-generator/meme_generator ADD dianzhongdian/__init__.py meme-generator/meme_generator/memes/dianzhongdian/ # 如果有自己扩展包 # ADD extends/ /meme-extend CMD cd meme-generator && . .venv/bin/activate && python3 -m meme_generator.app