feat: add production deploy pipeline and fix dev CSS
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>
This commit is contained in:
26
deploy/sum-nohype.service
Normal file
26
deploy/sum-nohype.service
Normal file
@@ -0,0 +1,26 @@
|
||||
[Unit]
|
||||
Description=No Hype AI (Docker Compose)
|
||||
Requires=docker.service
|
||||
After=docker.service network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=deploy
|
||||
Group=www-data
|
||||
WorkingDirectory=/srv/sum/nohype
|
||||
|
||||
ExecStartPre=docker compose -f docker-compose.prod.yml pull --ignore-pull-failures
|
||||
ExecStart=docker compose -f docker-compose.prod.yml up --build
|
||||
ExecStop=docker compose -f docker-compose.prod.yml down
|
||||
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
TimeoutStartSec=300
|
||||
TimeoutStopSec=30
|
||||
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=sum-nohype
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user