Deploy on Railway
Same instance as local: **web**, **api**, and a stock Postgres.
Only web is public. Postgres and api stay on Railway’s private network.
Create three things#
- Postgres — Railway’s Postgres plugin. Default image. Not public.
- api — this repo. Dockerfile
crates/doso-api/Dockerfile, build context the repo root. Not public. - web — this repo. Dockerfile
web/Dockerfile. Attach your domain here.
That is the whole service list. Do not add tenant-runtime unless you are following deploy/saas.
Environment#
Set the public origin everywhere it appears (https://your.domain).
api
1DATABASE_URL=${{Postgres.DATABASE_PRIVATE_URL}}2HTTP_ADDR=:80803DOSO_AUTH_MODE=jwks4DOSO_JWKS_URL=http://${{web.RAILWAY_PRIVATE_DOMAIN}}:3000/api/auth/jwks5DOSO_AUTH_ISSUER=https://your.domain6DOSO_AUTH_AUDIENCE=https://your.domain7DOSO_PUBLIC_API_URL=https://your.domain8DOSO_SETTINGS_KEY_HEX=<64 hex characters>web
1NEXT_PUBLIC_DOSO_AUTH_MODE=session2NEXT_PUBLIC_API_URL=3DOSO_API_PROXY_TARGET=http://${{api.RAILWAY_PRIVATE_DOMAIN}}:80804BETTER_AUTH_URL=https://your.domain5BETTER_AUTH_SECRET=<random secret>6BETTER_AUTH_DATABASE_URL=${{Postgres.DATABASE_PRIVATE_URL}}Build web with NEXT_PUBLIC_DOSO_AUTH_MODE=session and an empty NEXT_PUBLIC_API_URL.
Then#
Deploy. Open https://your.domain and create the first account.
Desktop: Settings → Storage → Connect to server → https://your.domain.
Health checks: /healthz on api, / on web.