7 Commits

Author SHA1 Message Date
d7bfb44ced Merge pull request 'fix: remove sudo from deploy script' (#17) from fix/deploy-no-sudo into main
Some checks failed
CI / ci (push) Has been skipped
CI / pr-e2e (push) Has been skipped
CI / deploy (push) Has been skipped
CI / nightly-e2e (push) Failing after 44s
2026-02-28 22:16:30 +00:00
codex_a
ec3e1ee1bf fix: remove sudo from deploy script, use docker compose directly
Some checks failed
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Failing after 42s
CI / ci (pull_request) Successful in 1m1s
deploy user has no sudo for systemctl. Instead:
- Use 'docker compose up -d --force-recreate' to recreate the web
  container without needing systemctl
- Change Restart=always so systemd re-attaches after the container
  is recreated
- Replace 'sudo journalctl' with 'docker compose logs' in error path

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 22:15:02 +00:00
44ffae7f99 Merge pull request 'fix: auto-set Wagtail site hostname on startup' (#16) from fix/prod-site-hostname into main
Some checks failed
CI / ci (push) Has been skipped
CI / pr-e2e (push) Has been skipped
CI / nightly-e2e (push) Has been skipped
CI / deploy (push) Failing after 2m30s
2026-02-28 22:08:29 +00:00
codex_a
c9dab3e93b fix: use correct Host header in deploy health check
Some checks failed
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Failing after 44s
CI / ci (pull_request) Successful in 1m2s
ALLOWED_HOSTS doesn't include localhost, so curl with default Host
header always gets a 400 and the health check fails.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 21:55:58 +00:00
codex_a
349f1db721 fix: auto-set Wagtail site hostname from ALLOWED_HOSTS on startup
All checks were successful
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Successful in 1m4s
CI / ci (pull_request) Successful in 1m15s
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 21:54:27 +00:00
de56b564c5 Merge pull request 'feat: production deploy pipeline' (#15) from feat/deploy-pipeline into main
Some checks failed
CI / ci (push) Has been skipped
CI / pr-e2e (push) Has been skipped
CI / nightly-e2e (push) Has been skipped
CI / deploy (push) Failing after 1s
2026-02-28 21:50:04 +00:00
03fcbdb5ad Merge pull request 'feat: production deploy pipeline' (#14) from feat/deploy-pipeline into main
Some checks failed
CI / ci (push) Has been skipped
CI / pr-e2e (push) Has been skipped
CI / nightly-e2e (push) Has been skipped
CI / deploy (push) Failing after 5s
Reviewed-on: #14
2026-02-28 21:40:03 +00:00
3 changed files with 13 additions and 8 deletions

View File

@@ -15,20 +15,17 @@ cp "${APP_DIR}/docker-compose.prod.yml" "${SITE_DIR}/docker-compose.prod.yml"
echo "==> Ensuring static/media directories exist" echo "==> Ensuring static/media directories exist"
mkdir -p "${SITE_DIR}/static" "${SITE_DIR}/media" mkdir -p "${SITE_DIR}/static" "${SITE_DIR}/media"
echo "==> Building image" echo "==> Rebuilding and recreating web container"
docker compose -f "${SITE_DIR}/docker-compose.prod.yml" build --no-cache docker compose -f "${SITE_DIR}/docker-compose.prod.yml" up -d --no-deps --build --force-recreate web
echo "==> Restarting service"
sudo systemctl restart sum-nohype
echo "==> Waiting for health check" echo "==> Waiting for health check"
for i in $(seq 1 30); do for i in $(seq 1 30); do
if curl -fsS http://localhost:8001/ >/dev/null 2>&1; then if curl -fsS -H "Host: nohypeai.net" http://localhost:8001/ >/dev/null 2>&1; then
echo "==> Site is up" echo "==> Site is up"
exit 0 exit 0
fi fi
sleep 3 sleep 3
done done
echo "ERROR: site did not come up after 90s" >&2 echo "ERROR: site did not come up after 90s" >&2
sudo journalctl -u sum-nohype --no-pager -n 50 docker compose -f "${SITE_DIR}/docker-compose.prod.yml" logs --tail=50 web
exit 1 exit 1

View File

@@ -6,6 +6,14 @@ python manage.py tailwind build
python manage.py migrate --noinput python manage.py migrate --noinput
python manage.py collectstatic --noinput python manage.py collectstatic --noinput
# Set Wagtail site hostname from first entry in ALLOWED_HOSTS
python manage.py shell -c "
from wagtail.models import Site
import os
hostname = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')[0].strip()
Site.objects.update(hostname=hostname, port=443, site_name='No Hype AI')
"
exec gunicorn config.wsgi:application \ exec gunicorn config.wsgi:application \
--workers 3 \ --workers 3 \
--bind 0.0.0.0:8000 \ --bind 0.0.0.0:8000 \

View File

@@ -13,7 +13,7 @@ ExecStartPre=docker compose -f docker-compose.prod.yml pull --ignore-pull-failur
ExecStart=docker compose -f docker-compose.prod.yml up --build ExecStart=docker compose -f docker-compose.prod.yml up --build
ExecStop=docker compose -f docker-compose.prod.yml down ExecStop=docker compose -f docker-compose.prod.yml down
Restart=on-failure Restart=always
RestartSec=10 RestartSec=10
TimeoutStartSec=300 TimeoutStartSec=300
TimeoutStopSec=30 TimeoutStopSec=30