Deploy
Ship the apps on Vercel or your own server.
Le Hoetel deploys as the api, up to four Next apps, and a postgres database. All of them read the same env keys, see environment.
Vercel
Deploy web, dashboard and docs as separate Vercel projects from the same repo.
- import the repo and set the root directory to
apps/web, then repeat forapps/dashboardandapps/docs - add the env keys to each project
- host the
apiwhere bun or docker runs, and pointAPI_URLandAPI_PUBLIC_URLat it
Docker
Every app has a Dockerfile in apps/<app>/. The build context is the repo root and turbo prunes the workspace to what the app needs:
docker build -f apps/web/Dockerfile -t le-hoetel-web .
docker build -f apps/dashboard/Dockerfile -t le-hoetel-dashboard .
docker build -f apps/api/Dockerfile -t le-hoetel-api .
docker build -f apps/docs/Dockerfile -t le-hoetel-docs .Next apps are built with output: "standalone" and ship a healthcheck. Pass the env at run time.
Dokploy
Create a project with a postgres database, add one application per app with build type Dockerfile, path apps/<app>/Dockerfile and . as the context, set the env keys, and attach your domains. Use the api service's internal address for API_URL.
Staging from main
.github/workflows/staging.yml deploys main to a Dokploy compose service every time ci goes green on main. It does nothing, and stays green, until these are set in the repo settings:
| Where | Name | What it is |
|---|---|---|
| variable | DOKPLOY_URL | base url of Dokploy |
| variable | DOKPLOY_STAGING_COMPOSE_ID | id of the staging compose service |
| secret | DOKPLOY_TOKEN | Dokploy api key |
| variable | STAGING_API_URL | optional, the job waits for its /health |
Setup, once, in Dokploy:
- create a Compose service from this repo on
main, compose path./docker-compose.yml, auto deploy off (the workflow deploys) - set the env in its Environment tab:
BETTER_AUTH_SECRET,POSTGRES_PASSWORD,DEPLOY_ENV=staging,WEB_URL,DASHBOARD_URL,API_PUBLIC_URL,DOCS_URL, and the observability keys - attach the domains to the
web,dashboard,apianddocsservices - copy the service id into
DOKPLOY_STAGING_COMPOSE_ID
Staging never sends real messages: MESSAGING_LIVE stays false there, see environment. Run the workflow by hand from the Actions tab with workflow_dispatch.