# Deploy an app

Run deploy in your app’s folder. Dukoi works out what the app is and how to start it, so most apps need no config at all.

## Deploy

```sh
$ dukoi deploy
✓ Built on this computer
✓ Installed dependencies
✓ Packed hono-api (2.4 MB)
✓ Uploaded to a024
✓ Started and healthy (release 0004)

  Local    http://192.168.0.112:3000

  Logs     dukoi logs hono-api
  Public   dukoi expose hono-api

  Done in 9.8s
```

Pass a folder to deploy from somewhere else: `dukoi deploy starters/hono-api`.

## What runs

-   **Node apps.** A folder with `package.json`. Dukoi runs `scripts.start`, or else `main`, `index.js`, `server.js` or `src/index.js`.
-   **Static sites.** A folder with `index.html` and no `package.json`. Dukoi serves it.

The phone runs Node 24 directly, so `scripts.start` must be `node <file>.js`. Build TypeScript first: if there’s a `build` script, deploy runs it on your computer before uploading.

## What your app needs

Listen on the port in `PORT`. Dukoi checks that the app answers there within 10 seconds before it switches traffic over.

-   `PORT` and `HOST`: where to listen.
-   `DATA_DIR`: a folder that survives deploys and rollbacks. Keep databases and uploads here.
-   `NODE_ENV` is `production`.

Bots and workers that open no port can skip the check with `--no-health-check`. They count as healthy if they’re still running after 3 seconds.

## What gets uploaded

Deploy copies the folder, installs production dependencies **on your computer** and uploads the lot, so the phone never runs npm. It always leaves out `.git`, `node_modules`, `.env` and `.env.local`.

> Native modules don’t run on phones yet
> 
> Packages with compiled code, like `sharp` or `bcrypt`, stop the deploy with a pure JavaScript swap to try: `bcryptjs` for `bcrypt`, `node:sqlite` for `better-sqlite3`.

## Change a guess

You don’t need a config file. Add `dukoi.json` only to change what Dukoi worked out. Every field is optional, and `"healthCheck": false` turns the check off.

```
{
  "name": "my-api",
  "start": "node dist/server.js",
  "healthCheck": "/health",
  "ignore": ["fixtures"]
}
```

The name comes from `--name`, then `dukoi.json`, then `package.json`, then the folder name.
