File size: 900 Bytes
6220d49
 
 
5b87288
6220d49
4f79d7f
6220d49
4f79d7f
 
 
 
 
 
 
 
6220d49
 
5b87288
6220d49
 
 
5b87288
fcfa4c7
 
 
5b87288
6220d49
fcfa4c7
 
5b87288
fcfa4c7
6220d49
5b87288
fcfa4c7
6220d49
5b87288
6220d49
 
5b87288
15d850d
5b87288
 
6220d49
 
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
41
42
43
44
ARG PYTHON_VERSION=3.12.1
FROM python:${PYTHON_VERSION}-slim AS base


RUN apt-get update && \
    apt-get install -y pipenv && \
    apt-get install -y \
    fontconfig \
    fonts-dejavu \
    fonts-dejavu-core \
    fonts-dejavu-extra \
    fonts-liberation \
    fonts-noto \
    git \
    ffmpeg && \
    rm -rf /var/lib/apt/lists/*


ENV PORT=7860
ENV PIPENV_VENV_IN_PROJECT=1


RUN groupadd -g 1000 appuser && \
    useradd -m -u 1000 -g appuser appuser


WORKDIR /app
RUN chown -R appuser:appuser /app


USER appuser


COPY --chown=appuser:appuser . .


EXPOSE 7860


RUN pipenv install --dev --ignore-pipfile && \
    pipenv run pip install cloudinary uvicorn fastapi git+http://github.com/Simatwa/ytube-api ffmpeg-python python-multipart


CMD [ "pipenv", "run", "python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "8", "--timeout-keep-alive", "600" ]