Code Rewrite to support multi instances

This commit is contained in:
Benjamin Harder
2024-08-20 23:28:20 +02:00
parent 2041337914
commit 1663703186
80 changed files with 4560 additions and 2954 deletions

View File

@@ -1,25 +0,0 @@
#FROM python:3.9-slim-buster
# For debugging:
# sudo docker run --rm -it --entrypoint sh ghcr.io/manimatter/decluttarr:dev
FROM python:3.10.13-slim
# Define a build-time argument for IMAGE_TAG
ARG IMAGE_TAG
ARG SHORT_COMMIT_ID
# Set an environment variable using the build-time argument
ENV IMAGE_TAG=$IMAGE_TAG
ENV SHORT_COMMIT_ID=$SHORT_COMMIT_ID
LABEL org.opencontainers.image.source="https://github.com/ManiMatter/decluttarr"
ENV IS_IN_DOCKER 1
WORKDIR /app
COPY ./docker/requirements.txt ./docker/requirements.txt
RUN pip install --no-cache-dir -r docker/requirements.txt
COPY . .
CMD ["python", "main.py"]

42
docker/dockerfile Normal file
View File

@@ -0,0 +1,42 @@
#FROM python:3.9-slim-buster
# For debugging:
# First build:
# sudo docker build --no-cache --progress=plain -f ./docker/dockerfile -t decluttarr .
# Entering image (and printing env variables):
# sudo docker run --rm -it -w /app --entrypoint sh decluttarr -c "printenv; exec sh"
# Then run from host (using docker-compose and as image: decluttarr:latest)
# sudo docker run --rm -v "/config:/app/config" --name decluttarr decluttarr
# Entering running container:
# sudo docker exec -it -w /app decluttarr sh -c "printenv; exec sh"
# Alternatively: Inspect env vars via portainer
FROM python:3.10.13-slim
# Define a build-time argument for IMAGE_TAG
ARG IMAGE_TAG
ARG SHORT_COMMIT_ID
# Set an environment variable using the build-time argument
ENV IMAGE_TAG=$IMAGE_TAG
ENV SHORT_COMMIT_ID=$SHORT_COMMIT_ID
LABEL org.opencontainers.image.source="https://github.com/ManiMatter/decluttarr"
ENV IN_DOCKER=true
WORKDIR /app
# Copy files
COPY ./docker/requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py main.py
COPY src src
CMD ["python", "main.py"]
# For debugging:
# CMD ["sh", "-c", "while true; do sleep 1000; done"]

View File

@@ -2,8 +2,12 @@
requests==2.32.3
asyncio==3.4.3
python-dateutil==2.8.2
verboselogs==1.7
pytest==8.0.1
pytest-asyncio==0.23.5
pre-commit==3.8.0
black==24.8.0
pylint==3.3.3
autoflake==2.3.1
isort==5.13.2
envyaml==1.10.211231
demjson3==3.0.6