Producción en VPS2: Docker + nginx + TLS + auto-deploy#1
Open
eddndev wants to merge 3 commits into
Open
Conversation
- apps/api/Dockerfile: multi-stage build (dems-api + seed), hermetic (runtime sqlx only, no .sqlx needed); migrations run on startup. - deploy/docker-compose.prod.yml: api (127.0.0.1:8090) + dedicated postgres. - deploy/nginx/dems.eddndev.work.conf: reverse proxy template (certbot adds TLS). - deploy/.env.prod.example + deploy/README.md runbook. - gitignore deploy/.env.
Env.apiBaseUrl: builds de release → https://dems.eddndev.work; debug/profile mantienen los defaults locales (10.0.2.2 / localhost). El override por --dart-define=API_BASE_URL sigue teniendo prioridad.
Job 'deploy' (needs api+mobile, solo push a main) corre en el runner self-hosted de VPS2: rsync del checkout a /opt/dems (preservando deploy/.env), docker compose up -d --build, y health check contra /readyz.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumen
Monta DEMS API en producción en VPS2 (https://dems.eddndev.work) y automatiza el despliegue. La API ya está viva y verificada end-to-end (esta rama documenta/versiona la infra que se aplicó).
Cambios
Infra de despliegue (
924659f)apps/api/Dockerfile— build multi-stage (dems-api+seed), hermético (todo runtime sqlx, sin.sqlx). Migraciones corren al arrancar.deploy/docker-compose.prod.yml—api(127.0.0.1:8090) +postgresdedicado (volumen propio, no publicado).deploy/nginx/dems.eddndev.work.conf— reverse proxy (certbot añade TLS).deploy/.env.prod.example+deploy/README.md(runbook).deploy/.envgit-ignored.Mobile (
4508db8)Env.apiBaseUrl: builds de release → producción; debug/profile mantienen defaults locales; override--dart-define=API_BASE_URLsigue ganando.CI/CD (
7c421fe)deploy(needsapi+mobile, solo en push amain) corre en el runner self-hosted de VPS2: rsync a/opt/dems(preservadeploy/.env),docker compose up -d --build, health check contra/readyz.Estado en producción (ya aplicado)
restart: unless-stopped, sobreviven reboot.Notas
deploysolo dispara al hacer merge a main. En este PR correnapi+mobile(tests), nodeploy./opt/demses propiedad degithub-runnerpara permitir el deploy local del runner.