designsystemet icon indicating copy to clipboard operation
designsystemet copied to clipboard

Replace Vercel as hosting provider

Open mimarz opened this issue 8 months ago • 1 comments

We have been using Vercel for some time now and it has been giving us problems whenever we want to host something else than NextJS or in general configuration.

Explore other hosting providers.

Actions:

  • Test with using one of our apps (maybe www).
  • Test deployment via gh actions.
  • We need preview/production env.
  • We need to be able to spin up previews with custom domains from gh actions (like we do previews for our PRs, pr-id.theme.designsystemet.no).
  • Programatically cleanup/remove previews.

Create sub-issue for when testing for said providers.

mimarz avatar May 08 '25 08:05 mimarz

Few suggestions:

  • Netlify
    • Comes with preview out of the box, almost no config needed
  • Dokply (requires server)
  • Cloudflare pages (https://pages.cloudflare.com/)

Barsnes avatar May 08 '25 08:05 Barsnes

We have not out of nowhere gotten new problems with vercel, where it can't route anything.

Image

I think we should prioritize this

Barsnes avatar Aug 28 '25 07:08 Barsnes

I have done some research, and talked with other people in digdir. It looks like going for Azure (container apps for RR, and static web app for SB) is the way to go. We would then be on the same infrastructure as other teams/products, and it still supports what we do with Vercel (deploy, preview deploy)

Barsnes avatar Aug 29 '25 07:08 Barsnes

We have not out of nowhere gotten new problems with vercel, where it can't route anything.

Image I think we should prioritize this

To fix this we added

  "pnpm": {
    "overrides": {
      "@mjackson/node-fetch-server": "npm:@remix-run/node-fetch-server@^0.8.0"
    }
  },

to our package.json. We can probably remove this when changing to Azure

Barsnes avatar Sep 01 '25 07:09 Barsnes

We have now gotten access to Azure, and will be testing it this week

Barsnes avatar Sep 02 '25 08:09 Barsnes

Azure seems to work fine: https://www-test-ca-app.victoriousglacier-eb9399b9.norwayeast.azurecontainerapps.io/no The above url is only a test URL, being deployed form a docker image.

One thing that is also very nice, is that everything works the same as locally. For example #3795 is fixed without us doing anything: https://www-test-ca-app.victoriousglacier-eb9399b9.norwayeast.azurecontainerapps.io/no/fundamentals/design-tokens/sizes-and-spac

Barsnes avatar Sep 02 '25 10:09 Barsnes

Everything is now working for previews in #4010, but we can't test production deployments properly before we merge it into main. We don't use custom domains for preview deployments anymore, and will only do this for prod deployments going forward.

Some gotchas:

  • ENV vars are now set in workflow files
  • Storybook uses nginx to keep deployments similar
  • Docker is used to build images, and not something you need locally

When we merge the PR, this will happen:

  • Make a prod deployment
    • Check that everything is working
  • Add a temp custom domain (i.e. prod.designsystemet.no)
  • If everything is working fine, change domains to point to azure (www, themebuilder, storybook)
  • Remove everything from Vercel
  • Move domain away from Vercel
  • Cancel Vercel subscription

Barsnes avatar Sep 11 '25 07:09 Barsnes

we are now on Azure. Domains remain on Vercel. For now.

Barsnes avatar Oct 06 '25 08:10 Barsnes