diff --git a/server/.dockerignore b/server/.dockerignore new file mode 100644 index 0000000..468083f --- /dev/null +++ b/server/.dockerignore @@ -0,0 +1,5 @@ +__pycache__/ +*.pyc +tests/ +docs/ +.git/ diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..5a9b380 --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.12-slim + +RUN apt-get update \ + && apt-get install -y --no-install-recommends ffmpeg \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app +COPY server/requirements.txt /app/server/requirements.txt +RUN pip install --no-cache-dir -r /app/server/requirements.txt yt-dlp + +COPY musicfetch /app/musicfetch +COPY server /app/server + +EXPOSE 6769 +CMD ["sh", "-c", "uvicorn server.app:app --host 0.0.0.0 --port ${MUSICFETCH_PORT:-6769}"] diff --git a/server/docker-compose.yml b/server/docker-compose.yml new file mode 100644 index 0000000..98faa9b --- /dev/null +++ b/server/docker-compose.yml @@ -0,0 +1,25 @@ +services: + musicfetch-api: + build: + context: .. + dockerfile: server/Dockerfile + container_name: musicfetch-api + restart: unless-stopped + ports: + - "6769:6769" + environment: + LIDARR_URL: "http://lidarr:8686" + LIDARR_API_KEY: "${LIDARR_API_KEY}" + MUSICFETCH_API_KEY: "${MUSICFETCH_API_KEY}" + MUSICFETCH_ROOT: "/media/music" + MUSICFETCH_PORT: "6769" + volumes: + - /media/music:/media/music + networks: + - lidarr_net + +networks: + lidarr_net: + external: true + # Set to the actual network name of your existing Lidarr stack, e.g.: + # name: media_default