Skip to content

Commit

Permalink
i wonder if this will work
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenstorm committed Feb 5, 2025
1 parent 26a936e commit 019d92f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
10 changes: 8 additions & 2 deletions youtube-dl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ RUN apt-get update && apt-get install -y \
# Copy project files
COPY pyproject.toml .
COPY uv.lock .
COPY yt-dlp.sh .
COPY entrypoint.sh /entrypoint.sh

# uv stuff
RUN . "${HOME}/.local/bin/env" \
&& uv venv .venv \
&& . .venv/bin/activate \
&& uv pip install -e . \
# Install yt-dlp
&& uv pip install -U --pre yt-dlp
&& uv pip install -U --pre yt-dlp \
# Create update script
&& chmod +x /entrypoint.sh \
&& chmod +x /app/yt-dlp.sh \
&& echo '*/10 * * * * /app/yt-dlp.sh' | crontab -

# Copy application code
COPY . .
Expand All @@ -41,4 +47,4 @@ ENV YOUTUBEDL_DEBUG=false \
PATH="/app/.venv/bin:${PATH}"

# Run the app using the Python from the virtual environment
CMD ["/app/.venv/bin/python", "src/main.py"]
ENTRYPOINT ["/entrypoint.sh"]
3 changes: 3 additions & 0 deletions youtube-dl/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
service cron start
exec /app/.venv/bin/python src/main.py
10 changes: 10 additions & 0 deletions youtube-dl/yt-dlp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Activate the virtual environment
. /app/.venv/bin/activate

# Install the package
uv pip install -e .

# Upgrade yt-dlp
uv pip install -U --pre yt-dlp

0 comments on commit 019d92f

Please sign in to comment.