File size: 1,187 Bytes
1f9a4c8
 
 
 
105d89f
 
 
 
 
 
1f9a4c8
 
 
 
 
 
 
 
 
105d89f
1f9a4c8
 
 
 
84fc37c
1f9a4c8
d24ac67
1f9a4c8
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 install && . .venv/bin/activate && python -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