Migrate hosting: Vercel (Astro) + Railway (PocketBase)#3
Merged
Conversation
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
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
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
micio86dev-portfolio): built frompb/Dockerfile, persistent volume at/pb/pb_data, production data restored & verified (realprojects,customers=9,storage/files served). Temp URL:pocketbase-production-310c.up.railway.app.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.Changes
astro/
astro.config.mjs: environment-selected adapter —@astrojs/vercelwhenVERCEL=1, else@astrojs/nodestandalone (Docker/DO). One config, both targets.@astrojs/vercel@9(Astro 5–compatible major; v11 requires Astro 7).vercel.json: force theastroframework preset..gitignore: ignore.vercel/.pb/
Dockerfile: drop theVOLUMEinstruction (Railway's builder rejects it; docker-compose overrides it anyway); installgosu; run viaentrypoint.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 thepocketbaseuser viagosu; bind PB to[::]:8090(Railway's private network is IPv6-only →0.0.0.0is unreachable by the edge proxy).root
.gitignore: never commitpb_backup*.zip(live contact-form records / PII; public repo).Remaining: DNS on register.it
@76.76.21.21wwwcname.vercel-dns.compbgb9iqlr9.up.railway.appTLS is auto-issued by both platforms once records resolve. Suggested order:
pbfirst, then@/www. Decommission the DigitalOcean droplet after verifyinghttps://micio86dev.itandhttps://pb.micio86dev.it/_/.🤖 Generated with Claude Code
https://claude.ai/code/session_01Cypse4mAxF3NyLnPxVYpMn