From f7cb691a7b3025fe87f1d9b68c9e422ffe587b2e Mon Sep 17 00:00:00 2001 From: Anon <206556099+An0n-01@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:24:01 +0100 Subject: [PATCH 1/2] feat: add Docker support with Dockerfile and docker-compose configuration --- Dockerfile | 43 +++++++++++++++++++++++++ README.md | 80 ++++++++++++++++++++++++++--------------------- compose.yml | 36 +++++++++++++++++++++ package-lock.json | 6 ++-- 4 files changed, 126 insertions(+), 39 deletions(-) create mode 100644 Dockerfile create mode 100644 compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..97e906d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +# Build stage +FROM node:18-alpine AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +# Production stage +FROM node:18-alpine + +WORKDIR /app + +# Define default values +ARG NODE_ENV=production +ARG PORT=3000 +ARG CACHE_TYPE=memory + +# Set environment variables +ENV NODE_ENV=${NODE_ENV} +ENV HOST=0.0.0.0 +ENV PORT=${PORT} +ENV CACHE_TYPE=${CACHE_TYPE} + +# Copy only production dependencies +COPY package*.json ./ +RUN npm ci --only=production + +# Copy built application +COPY --from=builder /app/dist ./dist + +# Create non-root user +RUN addgroup -g 1001 -S nodejs && \ + adduser -S nodejs -u 1001 + +USER nodejs + +EXPOSE ${PORT} + +CMD ["node", "dist/server.js"] \ No newline at end of file diff --git a/README.md b/README.md index 3092e47..bc18a34 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # CinePro Core 🎬 -## _🌟 Please star this repository! 🌟_ +## _🌟 Star this repository to support us! 🌟_ **OMSS-compliant streaming backend powering the CinePro ecosystem.**
Built with [@omss/framework](https://www.npmjs.com/package/@omss/framework) for extensible, type-safe media scraping and streaming. @@ -23,11 +23,13 @@ Built on the [OMSS template](https://github.com/omss-spec/template), this backen - 🎯 **OMSS-Compliant** – Follows the Open Media Streaming Standard specification - πŸ”Œ **Modular Providers** – Drop-in provider system with auto-discovery - πŸ›‘οΈ **Type-Safe** – Full TypeScript implementation with strict types -- ⚑ **Production-Ready** – Redis caching, Docker support (soon), error handling +- ⚑ **Production-Ready** – Redis caching, Docker support, error handling - 🎬 **Multi-Source** – Support for movies and TV shows from multiple providers - πŸ”„ **Hot Reload** – Development mode with automatic restarts - πŸ“¦ **CineHome Integration** – Compatible with CineHome download automation and any other CinePro ecosystem products +✨Please star this repository if you find it useful! It helps us gain visibility and continue improving the project!✨ + --- ## πŸš€ Quick Start @@ -76,6 +78,46 @@ npm run build npm start ``` +### Docker Deployment + +#### With Docker Compose (includes Redis) + +```bash +# Create .env file with your TMDB_API_KEY +cp .env.example .env +# Edit .env and add your TMDB_API_KEY + +# Start services +docker-compose up -d + +# Server runs at http://localhost:3000 or whatever you set in .env +``` + +#### Standalone Docker + +```bash +# Build image +docker build -t cinepro-core:latest . + +# Run with memory cache +docker run -p 3000:3000 \ + -e TMDB_API_KEY=your_tmdb_api_key_here \ + -e CACHE_TYPE=memory \ + cinepro-core:latest +``` + +#### Custom Configuration + +```bash +# Custom port and Redis +docker run -p 8080:8080 \ + -e PORT=8080 \ + -e TMDB_API_KEY=your_key \ + -e CACHE_TYPE=redis \ + -e REDIS_HOST=your-redis-host \ + cinepro-core:latest +``` + --- ## πŸ“ Project Structure @@ -93,40 +135,6 @@ core/ --- -## πŸ”Œ Adding Providers - -CinePro Core uses an extensible provider system. Each provider implements the `BaseProvider` interface to supply streaming sources. - -### Create a New Provider - -```typescript -// src/providers/mysite.ts -import { BaseProvider } from '@omss/framework'; - -export class MySiteProvider extends BaseProvider { - readonly id = 'mysite'; - readonly name = 'My Streaming Site'; - readonly BASE_URL = 'https://mysite.com'; - readonly capabilities = { - supportedContentTypes: ['movies', 'tv'] - }; - - async getMovieSources(tmdbId: string) { - // Implementation - } - - async getTVSources(tmdbId: string, season: number, episode: number) { - // Implementation - } -} -``` - -### Auto-Discovery - -Place your provider in `src/providers/` and restart the server. The framework automatically discovers and registers new providers. - ---- - ## βš™οΈ Configuration ### Environment Variables diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..156e556 --- /dev/null +++ b/compose.yml @@ -0,0 +1,36 @@ +services: + cinepro-core: + build: . + ports: + - "3000:3000" + environment: + - HOST=0.0.0.0 + - PORT=3000 + - NODE_ENV=production + - TMDB_API_KEY=${TMDB_API_KEY} + - TMDB_CACHE_TTL=86400 + - CACHE_TYPE=redis + - REDIS_HOST=redis + - REDIS_PORT=6379 + depends_on: + - redis + restart: unless-stopped + networks: + - omss-network + + redis: + image: redis:7-alpine + ports: + - "6379:6379" + volumes: + - redis-data:/data + restart: unless-stopped + networks: + - omss-network + +volumes: + redis-data: + +networks: + omss-network: + driver: bridge \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9d0e5b6..c172c22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1069,9 +1069,9 @@ } }, "node_modules/find-my-way": { - "version": "9.4.0", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.4.0.tgz", - "integrity": "sha512-5Ye4vHsypZRYtS01ob/iwHzGRUDELlsoCftI/OZFhcLs1M0tkGPcXldE80TAZC5yYuJMBPJQQ43UHlqbJWiX2w==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.5.0.tgz", + "integrity": "sha512-VW2RfnmscZO5KgBY5XVyKREMW5nMZcxDy+buTOsL+zIPnBlbKm+00sgzoQzq1EVh4aALZLfKdwv6atBGcjvjrQ==", "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", From 808b946f4e743851f67d47934fc8608605002d9f Mon Sep 17 00:00:00 2001 From: Anon <206556099+An0n-01@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:24:26 +0100 Subject: [PATCH 2/2] fix: prettier --- compose.yml | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/compose.yml b/compose.yml index 156e556..3a97ce9 100644 --- a/compose.yml +++ b/compose.yml @@ -1,36 +1,36 @@ services: - cinepro-core: - build: . - ports: - - "3000:3000" - environment: - - HOST=0.0.0.0 - - PORT=3000 - - NODE_ENV=production - - TMDB_API_KEY=${TMDB_API_KEY} - - TMDB_CACHE_TTL=86400 - - CACHE_TYPE=redis - - REDIS_HOST=redis - - REDIS_PORT=6379 - depends_on: - - redis - restart: unless-stopped - networks: - - omss-network + cinepro-core: + build: . + ports: + - '3000:3000' + environment: + - HOST=0.0.0.0 + - PORT=3000 + - NODE_ENV=production + - TMDB_API_KEY=${TMDB_API_KEY} + - TMDB_CACHE_TTL=86400 + - CACHE_TYPE=redis + - REDIS_HOST=redis + - REDIS_PORT=6379 + depends_on: + - redis + restart: unless-stopped + networks: + - omss-network - redis: - image: redis:7-alpine - ports: - - "6379:6379" - volumes: - - redis-data:/data - restart: unless-stopped - networks: - - omss-network + redis: + image: redis:7-alpine + ports: + - '6379:6379' + volumes: + - redis-data:/data + restart: unless-stopped + networks: + - omss-network volumes: - redis-data: + redis-data: networks: - omss-network: - driver: bridge \ No newline at end of file + omss-network: + driver: bridge