Save youtube before it dies
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6 KiB

1 year ago
  1. FROM python:3.11-bullseye
  2. # We don't want to run our application as root if it is not strictly necessary, even in a container.
  3. # Create a user and a group called 'app' to run the processes.
  4. RUN adduser app
  5. # Place the application components in a dir below the root dir
  6. COPY requirements.txt /app/requirements.txt
  7. # Make the directory the working directory for subsequent commands
  8. WORKDIR /app
  9. # Install from the requirements.txt we copied above
  10. RUN pip install -r requirements.txt
  11. # Download dbmate
  12. RUN mkdir /app/bin
  13. RUN curl -fsSL -o /app/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64
  14. RUN chmod +x /app/bin/dbmate
  15. RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /app/bin/yt-dlp
  16. RUN chmod +x /app/bin/yt-dlp
  17. RUN apt-get update && \
  18. apt-get -y --no-install-recommends install software-properties-common && \
  19. add-apt-repository "deb http://httpredir.debian.org/debian testing main" && \
  20. apt-get update && \
  21. apt-get -t testing install -y --no-install-recommends python3 ffmpeg
  22. # Place the application components in a dir below the root dir
  23. COPY . /app
  24. # Hand everything over to the 'app' user
  25. RUN chown -R app:app /app
  26. # Subsequent commands, either in this Dockerfile or in a
  27. # docker-compose.yml, will run as user 'app'
  28. USER app
  29. # We are done with setting up the image.
  30. # As this image is used for different
  31. # purposes and processes no CMD or ENTRYPOINT is specified here,
  32. # this is done in docker-compose.yml.
  33. #RUN mkdir $HOME/.cache
  34. #RUN chown -R app:app $HOME/app
  35. RUN bin/dbmate up