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>
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
services:
|
|
web:
|
|
build: .
|
|
working_dir: /app
|
|
command: >
|
|
sh -c "python manage.py tailwind install --no-input &&
|
|
python manage.py tailwind build &&
|
|
python manage.py migrate --noinput &&
|
|
python manage.py seed_e2e_content &&
|
|
python manage.py runserver 0.0.0.0:8000"
|
|
volumes:
|
|
- .:/app
|
|
ports:
|
|
- "8035:8000"
|
|
environment:
|
|
SECRET_KEY: dev-secret-key
|
|
DEBUG: "1"
|
|
ALLOWED_HOSTS: localhost,127.0.0.1,web
|
|
WAGTAIL_SITE_NAME: No Hype AI
|
|
DATABASE_URL: postgres://nohype:nohype@db:5432/nohype
|
|
DJANGO_SETTINGS_MODULE: config.settings.development
|
|
WAGTAILADMIN_BASE_URL: http://localhost:8035
|
|
CONSENT_POLICY_VERSION: "1"
|
|
EMAIL_BACKEND: django.core.mail.backends.console.EmailBackend
|
|
DEFAULT_FROM_EMAIL: hello@nohypeai.com
|
|
NEWSLETTER_PROVIDER: buttondown
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: nohype
|
|
POSTGRES_USER: nohype
|
|
POSTGRES_PASSWORD: nohype
|
|
volumes:
|
|
- nohype_pg:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U nohype -d nohype"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 5s
|
|
|
|
volumes:
|
|
nohype_pg:
|