Ajustes no compose e no dockerfile
This commit is contained in:
@@ -4,10 +4,14 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: dockerfile
|
dockerfile: dockerfile
|
||||||
container_name: youtube-api
|
container_name: youtube-api
|
||||||
|
dns: [8.8.8.8, 1.1.1.1]
|
||||||
|
sysctls:
|
||||||
|
- net.ipv6.conf.all.disable_ipv6=1
|
||||||
ports:
|
ports:
|
||||||
- "3011:8000"
|
- "3011:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- /root/videos:/app/videos
|
- /root/videos:/app/videos
|
||||||
|
# - ./videos:/app/videos
|
||||||
environment:
|
environment:
|
||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
34
dockerfile
34
dockerfile
@@ -1,19 +1,37 @@
|
|||||||
FROM python:3.10-slim
|
FROM python:3.10-slim-bookworm
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||||
ENV PYTHONUNBUFFERED=1
|
PYTHONUNBUFFERED=1 \
|
||||||
|
PIP_NO_CACHE_DIR=1 \
|
||||||
|
TZ=America/Sao_Paulo \
|
||||||
|
LANG=C.UTF-8 \
|
||||||
|
LC_ALL=C.UTF-8
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends ffmpeg && \
|
apt-get install -y --no-install-recommends \
|
||||||
rm -rf /var/lib/apt/lists/*
|
ca-certificates tzdata ffmpeg curl iputils-ping dnsutils procps \
|
||||||
|
&& update-ca-certificates \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt /app/requirements.txt
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
|
||||||
|
RUN python -m pip install --upgrade pip setuptools wheel && \
|
||||||
|
pip install -r /app/requirements.txt && \
|
||||||
|
pip install brotli brotlicffi mutagen certifi`
|
||||||
|
|
||||||
|
RUN printf "%s\n" \
|
||||||
|
"--force-ipv4" \
|
||||||
|
"--noplaylist" \
|
||||||
|
"--merge-output-format" "mp4" \
|
||||||
|
"--extractor-args" "youtube:player_client=android,player_skip=webpage" \
|
||||||
|
"--format" "bv*+ba/b[height<=1080]/b" \
|
||||||
|
> /etc/yt-dlp.conf
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 8000
|
RUN mkdir -p /app/videos && chmod 777 /app/videos
|
||||||
|
|
||||||
|
EXPOSE 8000
|
||||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
|
|||||||
Reference in New Issue
Block a user