Skip to content

Migrate hosting: Vercel (Astro) + Railway (PocketBase)#3

Merged
micio86dev merged 1 commit into
mainfrom
chore/migrate-vercel-railway
Jul 1, 2026
Merged

Migrate hosting: Vercel (Astro) + Railway (PocketBase)#3
micio86dev merged 1 commit into
mainfrom
chore/migrate-vercel-railway

Conversation

@micio86dev

Copy link
Copy Markdown
Owner

Migrates the portfolio off the single DigitalOcean VPS (docker-compose + host nginx) to a split deploy: Astro SSR frontend on Vercel, PocketBase on Railway with a persistent volume. All changes are backward-compatible with the existing docker-compose / DO images, so nothing breaks before the DNS cutover.

Status

  • Railway — PocketBase (micio86dev-portfolio): built from pb/Dockerfile, persistent volume at /pb/pb_data, production data restored & verified (real projects, customers=9, storage/ files served). Temp URL: pocketbase-production-310c.up.railway.app.
  • Vercel — Astro (micio86dev): production deploy on the Vercel adapter, env vars set (production + preview), SSR verified (HTTP 200, live PB data, i18n en/it/es). Temp URL: micio86dev.vercel.app.
  • DNS on register.it (manual — the only remaining step).

Changes

astro/

  • astro.config.mjs: environment-selected adapter — @astrojs/vercel when VERCEL=1, else @astrojs/node standalone (Docker/DO). One config, both targets.
  • add @astrojs/vercel@9 (Astro 5–compatible major; v11 requires Astro 7).
  • vercel.json: force the astro framework preset.
  • .gitignore: ignore .vercel/.

pb/

  • Dockerfile: drop the VOLUME instruction (Railway's builder rejects it; docker-compose overrides it anyway); install gosu; run via entrypoint.sh; start as root so the entrypoint can fix volume ownership before dropping privileges.
  • entrypoint.sh: chown the data dir when the mounted volume is root-owned (Railway) then drop to the pocketbase user via gosu; bind PB to [::]:8090 (Railway's private network is IPv6-only → 0.0.0.0 is unreachable by the edge proxy).

root

  • .gitignore: never commit pb_backup*.zip (live contact-form records / PII; public repo).

Remaining: DNS on register.it

Host Type Value
@ A 76.76.21.21
www CNAME cname.vercel-dns.com
pb CNAME gb9iqlr9.up.railway.app

TLS is auto-issued by both platforms once records resolve. Suggested order: pb first, then @/www. Decommission the DigitalOcean droplet after verifying https://micio86dev.it and https://pb.micio86dev.it/_/.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cypse4mAxF3NyLnPxVYpMn

Move off the single DigitalOcean VPS (docker-compose + host nginx) to a
split deploy: the Astro SSR frontend on Vercel, PocketBase on Railway with
a persistent volume. All changes are backward-compatible with the existing
docker-compose / DO images so nothing breaks before the DNS cutover.

astro/
- astro.config.mjs: pick the adapter from the environment — @astrojs/vercel
  when VERCEL=1, else @astrojs/node standalone (Docker/DO). One config, both
  targets.
- add @astrojs/vercel@9 (the Astro 5 compatible major; v11 needs Astro 7).
- vercel.json: force the `astro` framework preset (link-time detection missed
  it, and the adapter emits Build Output API v3).
- .gitignore: ignore .vercel/.

pb/
- Dockerfile: drop the `VOLUME` instruction (Railway's builder rejects it and
  docker-compose overrides it anyway); install gosu; run via entrypoint.sh
  instead of a hardcoded CMD; start as root so the entrypoint can fix volume
  ownership before dropping privileges.
- entrypoint.sh: chown the data dir when the mounted volume is root-owned
  (Railway) then drop to the `pocketbase` user via gosu; bind PB to [::]:8090
  (Railway's private network is IPv6-only, so 0.0.0.0 is unreachable by the
  edge proxy → 502).

.gitignore: never commit PocketBase backup archives (pb_backup*.zip) — they
contain live contact-form records (PII) and this is a public repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cypse4mAxF3NyLnPxVYpMn
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​astrojs/​vercel@​9.0.5100998397100

View full report

@micio86dev
micio86dev merged commit 1209de5 into main Jul 1, 2026
3 checks passed
@micio86dev
micio86dev deleted the chore/migrate-vercel-railway branch July 1, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant