meme-generator / Dockerfile
ikechan8370's picture
Update Dockerfile
be881bf verified
raw
history blame
1.21 kB
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
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 && 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