diff --git a/Dockerfile.fastapi b/Dockerfile.fastapi index 7c8672c..773ee1a 100644 --- a/Dockerfile.fastapi +++ b/Dockerfile.fastapi @@ -11,6 +11,9 @@ RUN pip install --no-cache-dir -r requirements_prod.txt #COPY server/py/fastapi_server/ ./ COPY ./server/py/fastapi_server/*.py ./ +# Copy the entrypoint to root +COPY ./server/py/fastapi_server/entrypoint.sh / + ENV PORT=8000 ENV HOST=0.0.0.0 ENV DOWNLOAD_FOLDER=/tmp/downloads @@ -22,4 +25,6 @@ ENV ROOT_PATH=/ VOLUME ["/tmp/downloads"] + +ENTRYPOINT ["/entrypoint.sh"] CMD ["python3", "main.py"] diff --git a/server/py/fastapi_server/entrypoint.sh b/server/py/fastapi_server/entrypoint.sh new file mode 100644 index 0000000..5fe0c63 --- /dev/null +++ b/server/py/fastapi_server/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# make sure it remains updated (don't crash if fails) +/usr/local/bin/pip install -U --no-cache-dir "yt-dlp[default]" || true + +exec "$@"