From e43fbd5cf9e71d9caa2b2697d107792a3d61a3ee Mon Sep 17 00:00:00 2001 From: Andrew Metzger Date: Sun, 10 Dec 2023 14:01:02 -0500 Subject: [PATCH] Use docker volume instead of env --- Dockerfile | 8 ++++++-- docker-compose.yml | 9 ++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5725a6a..699b8c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ FROM python:3.12 # Set the working directory in the container -WORKDIR /app +RUN mkdir "/beetseeker" +WORKDIR ["/beetseeker"] # Clone the GitHub repository RUN git clone https://github.com/andrewjmetzger/slskd-betanin-connector.git . @@ -10,8 +11,11 @@ RUN git clone https://github.com/andrewjmetzger/slskd-betanin-connector.git . # Install project dependencies RUN pip install --no-cache-dir -r requirements.txt +# Allow the config to be mounted +VOLUME ["/beetseeker"] + # Expose the port the app runs on EXPOSE 8347 # Command to run the application -CMD ["python", "main.py"] +CMD ["python", "main.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 90e990e..7bf9572 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,13 +3,8 @@ services: slskd-betanin-connector: image: andrewjmetzger/slskd-betanin-connector:latest container_name: slskd-betanin-connector - environment: - - SLSKD_BETANIN_CONNECTOR_PORT=8080 - - DOWNLOADS_DIRECTORY=/path/to/slskd/completed/downloads - - SLSKD_URL=http://localhost:5030 - - SLSKD_API_KEY=your_slskd_api_key - - BETANIN_URL=http://localhost:9393 - - BETANIN_API_KEY=your_betanin_api_key + volumes: + - /path/to/config.py:/app/config.py ports: - "8080:8080" restart: unless-stopped