From 138069590b1e9bfeef0bfae95159dca4d9ad4924 Mon Sep 17 00:00:00 2001 From: Rephl3x Date: Fri, 30 Jan 2026 21:54:25 +1300 Subject: [PATCH] Build 3001262148: single container --- Dockerfile | 53 +++++++++++++++++++++++++++++++++++++++ backend/app/build_info.py | 4 +-- docker-compose.hub.yml | 15 +++-------- docker-compose.yml | 19 +++----------- docker/supervisord.conf | 28 +++++++++++++++++++++ frontend/package.json | 2 +- 6 files changed, 90 insertions(+), 31 deletions(-) create mode 100644 Dockerfile create mode 100644 docker/supervisord.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c1c0321 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +FROM node:20-slim AS frontend-builder + +WORKDIR /frontend + +ENV NODE_ENV=production \ + BACKEND_INTERNAL_URL=http://127.0.0.1:8000 \ + NEXT_PUBLIC_API_BASE=/api + +COPY frontend/package.json ./ +RUN npm install + +COPY frontend/app ./app +COPY frontend/public ./public +COPY frontend/next-env.d.ts ./next-env.d.ts +COPY frontend/next.config.js ./next.config.js +COPY frontend/tsconfig.json ./tsconfig.json + +RUN npm run build + +FROM python:3.12-slim + +WORKDIR /app + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + NODE_ENV=production + +RUN apt-get update \ + && apt-get install -y --no-install-recommends curl gnupg supervisor \ + && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY backend/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY backend/app ./app +COPY data/branding /app/data/branding + +COPY --from=frontend-builder /frontend/.next /app/frontend/.next +COPY --from=frontend-builder /frontend/public /app/frontend/public +COPY --from=frontend-builder /frontend/node_modules /app/frontend/node_modules +COPY --from=frontend-builder /frontend/package.json /app/frontend/package.json +COPY --from=frontend-builder /frontend/next.config.js /app/frontend/next.config.js +COPY --from=frontend-builder /frontend/next-env.d.ts /app/frontend/next-env.d.ts +COPY --from=frontend-builder /frontend/tsconfig.json /app/frontend/tsconfig.json + +COPY docker/supervisord.conf /etc/supervisor/conf.d/magent.conf + +EXPOSE 3000 8000 + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/magent.conf"] diff --git a/backend/app/build_info.py b/backend/app/build_info.py index 0729a21..cbd26fa 100644 --- a/backend/app/build_info.py +++ b/backend/app/build_info.py @@ -1,2 +1,2 @@ -BUILD_NUMBER = "2901262244" -CHANGELOG = '2026-01-22\\n- Initial commit\\n- Ignore build artifacts\\n- Update README\\n- Update README with Docker-first guide\\n\\n2026-01-23\\n- Fix cache titles via Jellyseerr media lookup\\n- Split search actions and improve download options\\n- Fallback manual grab to qBittorrent\\n- Hide header actions when signed out\\n- Add feedback form and webhook\\n- Fix cache titles and move feedback link\\n- Show available status on landing when in Jellyfin\\n- Add default branding assets when missing\\n- Use bundled branding assets\\n- Remove password fields from users page\\n- Add Docker Hub compose override\\n- Fix backend Dockerfile paths for root context\\n- Copy public assets into frontend image\\n- Use backend branding assets for logo and favicon\\n\\n2026-01-24\\n- Route grabs through Sonarr/Radarr only\\n- Document fix buttons in how-it-works\\n- Clarify how-it-works steps and fixes\\n- Map Prowlarr releases to Arr indexers for manual grab\\n- Improve request handling and qBittorrent categories\\n\\n2026-01-25\\n- Add site banner, build number, and changelog\\n- Automate build number tagging and sync\\n- Improve mobile header layout\\n- Move account actions into avatar menu\\n- Add user stats and activity tracking\\n- Add Jellyfin login cache and admin-only stats\\n- Tidy request sync controls\\n- Seed branding logo from bundled assets\\n- Serve bundled branding assets by default\\n- Harden request cache titles and cache-only reads\\n- Build 2501262041\\n\\n2026-01-26\\n- Fix cache title hydration\\n- Fix sync progress bar animation\\n\\n2026-01-27\\n- Add cache control artwork stats\\n- Improve cache stats performance (build 271261145)\\n- Fix backend cache stats import (build 271261149)\\n- Clarify request sync settings (build 271261159)\\n- Bump build number to 271261202\\n- Fix request titles in snapshots (build 271261219)\\n- Fix snapshot title fallback (build 271261228)\\n- Add cache load spinner (build 271261238)\\n- Bump build number (process 2) 271261322\\n- Add service test buttons (build 271261335)\\n- Fallback to TMDB when artwork cache fails (build 271261524)\\n- Hydrate missing artwork from Jellyseerr (build 271261539)\\n\\n2026-01-29\\n- release: 2901262036\\n- release: 2901262044\\n- release: 2901262102\\n- Hardcode build number in backend\\n- Bake build number and changelog\\n- Update full changelog\\n- Tidy full changelog\\n- Build 2901262240: cache users' +BUILD_NUMBER = "3001262148" +CHANGELOG = '2026-01-22\\n- Initial commit\\n- Ignore build artifacts\\n- Update README\\n- Update README with Docker-first guide\\n\\n2026-01-23\\n- Fix cache titles via Jellyseerr media lookup\\n- Split search actions and improve download options\\n- Fallback manual grab to qBittorrent\\n- Hide header actions when signed out\\n- Add feedback form and webhook\\n- Fix cache titles and move feedback link\\n- Show available status on landing when in Jellyfin\\n- Add default branding assets when missing\\n- Use bundled branding assets\\n- Remove password fields from users page\\n- Add Docker Hub compose override\\n- Fix backend Dockerfile paths for root context\\n- Copy public assets into frontend image\\n- Use backend branding assets for logo and favicon\\n\\n2026-01-24\\n- Route grabs through Sonarr/Radarr only\\n- Document fix buttons in how-it-works\\n- Clarify how-it-works steps and fixes\\n- Map Prowlarr releases to Arr indexers for manual grab\\n- Improve request handling and qBittorrent categories\\n\\n2026-01-25\\n- Add site banner, build number, and changelog\\n- Automate build number tagging and sync\\n- Improve mobile header layout\\n- Move account actions into avatar menu\\n- Add user stats and activity tracking\\n- Add Jellyfin login cache and admin-only stats\\n- Tidy request sync controls\\n- Seed branding logo from bundled assets\\n- Serve bundled branding assets by default\\n- Harden request cache titles and cache-only reads\\n- Build 2501262041\\n\\n2026-01-26\\n- Fix cache title hydration\\n- Fix sync progress bar animation\\n\\n2026-01-27\\n- Add cache control artwork stats\\n- Improve cache stats performance (build 271261145)\\n- Fix backend cache stats import (build 271261149)\\n- Clarify request sync settings (build 271261159)\\n- Bump build number to 271261202\\n- Fix request titles in snapshots (build 271261219)\\n- Fix snapshot title fallback (build 271261228)\\n- Add cache load spinner (build 271261238)\\n- Bump build number (process 2) 271261322\\n- Add service test buttons (build 271261335)\\n- Fallback to TMDB when artwork cache fails (build 271261524)\\n- Hydrate missing artwork from Jellyseerr (build 271261539)\\n\\n2026-01-29\\n- release: 2901262036\\n- release: 2901262044\\n- release: 2901262102\\n- Hardcode build number in backend\\n- Bake build number and changelog\\n- Update full changelog\\n- Tidy full changelog\\n- Build 2901262240: cache users\n\n2026-01-30\n- Merge backend and frontend into one container' diff --git a/docker-compose.hub.yml b/docker-compose.hub.yml index 6b41387..f3c695c 100644 --- a/docker-compose.hub.yml +++ b/docker-compose.hub.yml @@ -1,19 +1,10 @@ services: - backend: - image: rephl3xnz/magent-backend:latest + magent: + image: rephl3xnz/magent:latest env_file: - ./.env ports: + - "3000:3000" - "8000:8000" volumes: - ./data:/app/data - - frontend: - image: rephl3xnz/magent-frontend:latest - environment: - - NEXT_PUBLIC_API_BASE=/api - - BACKEND_INTERNAL_URL=http://backend:8000 - ports: - - "3000:3000" - depends_on: - - backend diff --git a/docker-compose.yml b/docker-compose.yml index 1686bba..ebbc613 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,12 @@ services: - backend: + magent: build: context: . - dockerfile: backend/Dockerfile - args: - BUILD_NUMBER: ${BUILD_NUMBER} + dockerfile: Dockerfile env_file: - ./.env ports: + - "3000:3000" - "8000:8000" volumes: - ./data:/app/data - - frontend: - build: - context: ./frontend - dockerfile: Dockerfile - environment: - - NEXT_PUBLIC_API_BASE=/api - - BACKEND_INTERNAL_URL=http://backend:8000 - ports: - - "3000:3000" - depends_on: - - backend diff --git a/docker/supervisord.conf b/docker/supervisord.conf new file mode 100644 index 0000000..2cb5ceb --- /dev/null +++ b/docker/supervisord.conf @@ -0,0 +1,28 @@ +[supervisord] +nodaemon=true +logfile=/dev/null +logfile_maxbytes=0 +pidfile=/tmp/supervisord.pid + +[program:backend] +directory=/app +command=uvicorn app.main:app --host 0.0.0.0 --port 8000 +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +priority=10 + +[program:frontend] +directory=/app/frontend +command=/usr/bin/npm start -- --hostname 0.0.0.0 --port 3000 +environment=NEXT_PUBLIC_API_BASE="/api",BACKEND_INTERNAL_URL="http://127.0.0.1:8000",NODE_ENV="production" +autostart=true +autorestart=true +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +priority=20 diff --git a/frontend/package.json b/frontend/package.json index 394cc8b..07d4594 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "magent-frontend", "private": true, - "version": "2901262244", + "version": "3001262148", "scripts": { "dev": "next dev", "build": "next build",