0cbac68ec1eca208cba639a222fc532f4075d23d
Dev: - Add tailwind install + build to docker-compose startup so CSS is built inside the container — not dependent on local filesystem Production (docker-compose.prod.yml): - Gunicorn on 127.0.0.1:8001, bind-mounted static/media to host paths so Caddy can serve them directly - Runs migrate, tailwind build, collectstatic on startup Settings (production.py): - Disable SECURE_SSL_REDIRECT (Caddy handles redirects; Django would loop) - Add CSRF_TRUSTED_ORIGINS for nohypeai.net CI (.gitea/workflows/ci.yml): - Add push-to-main trigger - Add deploy job: SSHes to lintel-prod-01 as deploy, runs deploy/deploy.sh Server config (deploy/): - deploy/caddy/nohype.caddy — Caddy site config for nohypeai.net - deploy/sum-nohype.service — systemd unit for the compose stack - deploy/deploy.sh — deploy script (pull, build, restart) One-time manual steps required on lintel-prod-01 (need root): sudo cp deploy/sum-nohype.service /etc/systemd/system/ sudo cp deploy/caddy/nohype.caddy /etc/caddy/sites-enabled/ sudo systemctl daemon-reload && sudo systemctl enable sum-nohype sudo systemctl reload caddy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No Hype AI
Django 5.2 + Wagtail 7 blog engine for No Hype AI.
Environment Variables
Required:
SECRET_KEYDATABASE_URLALLOWED_HOSTSDEBUGWAGTAIL_SITE_NAME
Also used:
WAGTAILADMIN_BASE_URLCONSENT_POLICY_VERSIONEMAIL_BACKENDEMAIL_HOSTEMAIL_PORTEMAIL_USE_TLSEMAIL_HOST_USEREMAIL_HOST_PASSWORDDEFAULT_FROM_EMAILNEWSLETTER_PROVIDER
Containerized Development
docker compose build
docker compose run --rm web python manage.py migrate
docker compose up
App is exposed on http://localhost:8035.
Test/Lint/Typecheck (Docker)
docker compose run --rm web pytest
docker compose run --rm web ruff check .
docker compose run --rm web mypy apps config
Deploy Runbook
git pull origin main
pip install -r requirements/production.txt
python manage.py migrate --run-syncdb
python manage.py collectstatic --noinput
python manage.py tailwind build
python manage.py check_content_integrity
sudo systemctl reload gunicorn
Backups
- PostgreSQL dump daily:
pg_dump | gzip > backup-$(date +%Y%m%d).sql.gz MEDIA_ROOTrsynced offsite daily- Restore DB:
gunzip -c backup-YYYYMMDD.sql.gz | psql "$DATABASE_URL" - Restore media:
rsync -avz <backup-host>:/path/to/media/ /srv/nohypeai/media/
Runtime Notes
- Keep Caddy serving
/static/and/media/directly in production. - Keep Gunicorn behind Caddy and run from a systemd service/socket pair.
- Use
python manage.py purge_old_comment_data --months 24in cron for comment-data retention.
Description
Languages
Python
63.5%
HTML
33.1%
JavaScript
1.4%
Makefile
0.9%
Shell
0.5%
Other
0.6%