Skip to content

Deploy (CPU/CUDA images, Cloudflare Tunnel, backups) and a new README with docs/ - #15

Merged
botta0oss merged 4 commits into
mainfrom
claude/lucid-lovelace-h1c8tm
Sep 25, 2026
Merged

botta0oss merged 4 commits into
mainfrom
claude/lucid-lovelace-h1c8tm

Conversation

@botta0oss

@botta0oss botta0oss commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Docker images

  • Dockerfile (default): installs PyTorch from the CPU-only index, so servers no longer download the CUDA build (several GB). The build fails if a CUDA torch slips in.
  • Dockerfile.cuda: keeps the CUDA build for a local NVIDIA GPU. docker-compose.gpu.yml switches the api service to it and reserves the host's GPUs.
  • Distinct image tags (news-aggregator-api:cpu / :cuda). The startup log says which device the embedding model uses.

Deploy on a VPS with Cloudflare Tunnel

  • Compose: database password from POSTGRES_PASSWORD in .env; app port bound to 127.0.0.1 (API_BIND); restart: unless-stopped on every service.
  • Optional profiles:
    • tunnel: cloudflared with CLOUDFLARE_TUNNEL_TOKEN, HTTPS with no open ports.
    • backup: daily pg_dump in ./backups, keeping BACKUP_KEEP_DAYS days.
  • CLIENT_IP_HEADER=CF-Connecting-IP: behind the tunnel every request comes from cloudflared, so without it the login limits would treat everyone as one IP.
  • scripts/update.sh: pulls, rebuilds and restarts.
  • .env.example: DEFAULT_FEE_BPS and MARKET_NEWS_WINDOW_HOURS aligned with the current defaults. A copied .env was overriding them with the old values.

Local and home-network use

  • docs/deploy.md: running locally needs no tunnel, because the optional services are profiles. To open the dashboard from other devices at home, set API_BIND=0.0.0.0 and SESSION_COOKIE_SECURE=false, with a warning about plain HTTP.
  • docs/configurazione.md: lists the Docker compose variables.
  • Login: when the password is right but the browser refuses the session cookie (a Secure cookie over plain HTTP from a network address), the form now says so and names the setting. Before, it silently showed the login again. Checked in a browser in three cases:
    • via a network address with auto: the message appears;
    • via localhost with auto: sign-in works;
    • via a network address with false: sign-in works.

README and documentation

  • README as a landing page:
    • centered header with badges and quick links;
    • hero screenshot, features grid, screenshot gallery (light and dark via <picture>);
    • how it works (diagram and five steps);
    • quick start, hosting costs, essential configuration;
    • documentation index, tech stack, known limits.
  • docs/: the previous sections split by topic, with an index. Internal links were rewritten across pages and checked.
  • Out-of-date content fixed along the way:
    • known limits: multi-outcome markets are supported, and fees no longer come from takerBaseFee;
    • dashboard table: added Cosa fare, Portafoglio, Uso e costi, and intervals and CLV in Calibrazione;
    • pipeline table, project tree, test list, and the local-install note about migrations.
  • docs/images: screenshots of the demo data, about 1.1 MB in total; docs is excluded from the Docker build context.

Verification

  • Tests: 184 pass.
  • Compose: docker compose config resolves all combinations.
  • Backup: the loop was run against a local Postgres; the dump was restored and the row counts match.
  • Docs:
    • no content lost in the split: every line of the old README is present in the new pages, except the lines intentionally rewritten;
    • all relative links and images resolve.
  • Not run here: there is no Docker daemon, and download.pytorch.org and shields.io are blocked by this environment's proxy. The images, the live tunnel and the badges were not exercised.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj

- Dockerfile installs PyTorch from the CPU-only index before the requirements, so servers and
  VPSs no longer download the CUDA build (several GB); the build fails if a CUDA torch slips in.
- Dockerfile.cuda keeps the default PyPI build with CUDA; docker-compose.gpu.yml switches the
  api service to it and reserves the host's NVIDIA GPUs.
- Distinct image tags (cpu / cuda) so switching does not rebuild every time; the startup log
  says which device the embedding model uses.
- README: when to use which, and the CPU-only pip command for local installs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
…ecrets from .env

- docker-compose.yml: database password from POSTGRES_PASSWORD; app port bound to 127.0.0.1
  by default (API_BIND); restart policies; optional services by profile: "tunnel"
  (cloudflared with CLOUDFLARE_TUNNEL_TOKEN, HTTPS with no open ports) and "backup" (daily
  pg_dump in ./backups, BACKUP_KEEP_DAYS kept).
- CLIENT_IP_HEADER: behind the tunnel every request comes from cloudflared, so the login
  limits use Cloudflare's CF-Connecting-IP when configured.
- scripts/update.sh: pull, rebuild, restart.
- .env.example: new settings; DEFAULT_FEE_BPS and MARKET_NEWS_WINDOW_HOURS aligned with the
  current defaults (a copied .env was overriding them with the old values).
- README: step-by-step deploy guide (server, Docker, tunnel, .env, start, update, backup and
  restore, troubleshooting).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
@botta0oss botta0oss changed the title Docker: CPU-only image by default, separate CUDA image for a local GPU Deploy: CPU/CUDA Docker images, Cloudflare Tunnel, daily backups, secrets from .env Sep 25, 2026
- README: centered header with badges and quick links, hero screenshot, features grid,
  screenshot gallery (light and dark via <picture>), how it works (diagram and five steps),
  quick start, hosting costs, essential configuration, documentation index, stack, limits.
- docs/: the previous sections split by topic (guida, metodo, strategia, allerte, verifica,
  costi, configurazione, sicurezza, deploy, api, sviluppo) with an index; internal links
  rewritten across pages and checked.
- Out-of-date content fixed on the way: limits (multi-outcome markets are supported, fees no
  longer from takerBaseFee), dashboard table (Cosa fare, Portafoglio, Uso e costi,
  intervals and CLV in Calibrazione), pipeline table, project tree and test list, local
  install note about migrations.
- docs/images: screenshots of the demo data, dark ones compressed to 256 colours; docs are
  excluded from the Docker build context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
@botta0oss botta0oss changed the title Deploy: CPU/CUDA Docker images, Cloudflare Tunnel, daily backups, secrets from .env Deploy (CPU/CUDA images, Cloudflare Tunnel, backups) and a new README with docs/ Sep 25, 2026
…essage when the cookie is refused

- docs/deploy.md: new section on running locally (no tunnel needed: optional services are
  profiles) and opening the dashboard from other devices at home (API_BIND=0.0.0.0 and
  SESSION_COOKIE_SECURE=false, with the plain-HTTP warning).
- docs/configurazione.md: the Docker compose variables (POSTGRES_PASSWORD, COMPOSE_PROFILES,
  CLOUDFLARE_TUNNEL_TOKEN, BACKUP_KEEP_DAYS, API_BIND).
- Login: when the password is right but the browser refuses the session cookie (Secure cookie
  over plain HTTP from a network address), the form now says so and names the setting, instead
  of silently showing the login again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
@botta0oss
botta0oss merged commit 0376d31 into main Sep 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants