File size: 692 Bytes
9cf661f
 
 
7c1fd43
9cf661f
e902a4a
 
7c1fd43
9cf661f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use Python 3.9 Slim
FROM python:3.9-slim

# Install FFmpeg, libass, and FONTS
RUN apt-get update && \
    apt-get install -y ffmpeg libass-dev wget \
    fonts-liberation fonts-dejavu fonts-freefont-ttf fontconfig && \
    fc-cache -f -v && \
    rm -rf /var/lib/apt/lists/*

# Setup User
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy all python files
COPY --chown=user app.py .
COPY --chown=user ass_generator.py .
COPY --chown=user styles.py .

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]