# Deploy Nuxt from a monorepo

Run the deploy from your repository root. Reverhost builds the Dockerfile stored on your app, using either your Nuxt folder or the whole repository as the build context.

## A self-contained app folder

If `apps/web` has its own lockfile and no workspace dependencies, make it the build context.

```
npx ezhst link --project <project-slug> --app <app-slug>
npx ezhst build set --root-dir apps/web
npx ezhst build dockerfile set -f apps/web/Dockerfile
npx ezhst deploy
```

With a root directory set, the Dockerfile's `COPY` paths are relative to `apps/web`, so the [Nuxt hosting Dockerfile](/free-nuxt-hosting) works as is.

## An app that uses workspace packages

Leave the root directory empty so the whole repository is the build context. Install at the root, build only your app, then start it from its folder.

```Dockerfile
FROM node:22-alpine
WORKDIR /app
COPY . .
RUN npm ci
RUN --mount=type=secret,id=appenv,target=/run/secrets/appenv sh -c 'set -a; . /run/secrets/appenv; set +a; npx turbo run build --filter=./apps/web'
WORKDIR /app/apps/web
ENV NODE_ENV=production PORT=3000 HOST=0.0.0.0
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
```

Nx works the same way with `npx nx build <project>` as the build command.

## Several apps, one project

A project holds 2 apps. Create one Reverhost app per deployable folder, each with its own Dockerfile and root directory. They share the project's database and bucket.

See the [Nuxt hub](/frameworks/nuxt) for every Nuxt guide, or [free Nuxt hosting](/free-nuxt-hosting) for what is included.

## Frequently asked questions

### Where should I run ezhst deploy?

From the repository root, so shared packages and the lockfile are included in the upload.
