diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..78ce602 --- /dev/null +++ b/.env.example @@ -0,0 +1,28 @@ +# NFOGuard Environment Variables + +# User and Group IDs +PUID=1000 +PGID=1000 + +# Timezone +TZ=UTC + +# Media path (for read-only access to scan NFO files) +MEDIA_PATH=/path/to/your/media + +# Database settings (if using PostgreSQL) +# DB_USER=nfoguard +# DB_PASSWORD=your_secure_password + +# Emby Plugin Deployment - Bind Mount Method (Recommended) +# Set this to the path where Emby plugins are installed on your host +# Common paths: +# - /var/lib/emby/plugins (native Emby install) +# - /path/to/emby/config/plugins (Docker Emby) +# - /config/plugins (linuxserver.io Emby) +EMBY_PLUGINS_PATH=/path/to/emby/plugins + +# NFOGuard specific settings +DEBUG=false +PATH_DEBUG=false +SUPPRESS_TVDB_WARNINGS=true \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5514048..868805b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,25 @@ RUN pip install --no-cache-dir --upgrade pip && \ # Copy application code COPY . . +# Copy DLL to a dedicated directory and create entrypoint script +RUN mkdir -p /app/emby-plugin && \ + cp /app/Emby-DLL/NFOGuard.Emby.Plugin.dll /app/emby-plugin/ && \ + echo '#!/bin/bash' > /app/deploy-plugin.sh && \ + echo 'if [ -d "/emby-plugins" ]; then' >> /app/deploy-plugin.sh && \ + echo ' echo "Deploying NFOGuard Emby Plugin to mounted directory: /emby-plugins"' >> /app/deploy-plugin.sh && \ + echo ' cp /app/emby-plugin/NFOGuard.Emby.Plugin.dll /emby-plugins/' >> /app/deploy-plugin.sh && \ + echo ' echo "Plugin deployed successfully!"' >> /app/deploy-plugin.sh && \ + echo 'elif [ -n "$EMBY_PLUGINS_PATH" ] && [ -d "$EMBY_PLUGINS_PATH" ]; then' >> /app/deploy-plugin.sh && \ + echo ' echo "Deploying NFOGuard Emby Plugin to: $EMBY_PLUGINS_PATH"' >> /app/deploy-plugin.sh && \ + echo ' cp /app/emby-plugin/NFOGuard.Emby.Plugin.dll "$EMBY_PLUGINS_PATH/"' >> /app/deploy-plugin.sh && \ + echo ' echo "Plugin deployed successfully!"' >> /app/deploy-plugin.sh && \ + echo 'else' >> /app/deploy-plugin.sh && \ + echo ' echo "No Emby plugins directory found - skipping plugin deployment"' >> /app/deploy-plugin.sh && \ + echo ' echo "To enable plugin deployment, bind mount your Emby plugins directory to /emby-plugins"' >> /app/deploy-plugin.sh && \ + echo 'fi' >> /app/deploy-plugin.sh && \ + echo 'exec python nfoguard.py' >> /app/deploy-plugin.sh && \ + chmod +x /app/deploy-plugin.sh + # Set ownership RUN chown -R app:app /app @@ -37,5 +56,5 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ # Expose port EXPOSE 8080 -# Run the application -CMD ["python", "nfoguard.py"] \ No newline at end of file +# Run the application with plugin deployment +CMD ["/app/deploy-plugin.sh"] \ No newline at end of file diff --git a/Emby-DLL/NFOGuard.Emby.Plugin.dll b/Emby-DLL/NFOGuard.Emby.Plugin.dll new file mode 100644 index 0000000..aa3a736 Binary files /dev/null and b/Emby-DLL/NFOGuard.Emby.Plugin.dll differ diff --git a/docker-compose.example.yml b/docker-compose.example.yml new file mode 100644 index 0000000..9eac4ad --- /dev/null +++ b/docker-compose.example.yml @@ -0,0 +1,40 @@ +version: '3.8' + +services: + nfoguard: + image: ghcr.io/jskala/nfoguard:latest + container_name: nfoguard + restart: unless-stopped + ports: + - "8080:8080" + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} + - TZ=${TZ:-UTC} + volumes: + - ./data:/app/data + - ./config:/app/config + - ${MEDIA_PATH}:/media:ro + # Bind mount your Emby plugins directory for automatic plugin deployment + - ${EMBY_PLUGINS_PATH}:/emby-plugins + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + + # Optional: PostgreSQL database + # postgres: + # image: postgres:15 + # container_name: nfoguard-db + # restart: unless-stopped + # environment: + # POSTGRES_DB: nfoguard + # POSTGRES_USER: ${DB_USER:-nfoguard} + # POSTGRES_PASSWORD: ${DB_PASSWORD} + # volumes: + # - postgres_data:/var/lib/postgresql/data + +# volumes: +# postgres_data: \ No newline at end of file