# dflow apps:build

> Build a GitHub repository or a local directory, then deploy it.

Web page: /docs/cli/apps/apps-build/

This builds a GitHub repository or a directory on your machine, stores the image, and deploys it. The build job runs Railpack prepare. Settings you do not pass on the command come from a `dflow.json` file in that source. CPU and memory come only from that file. Environment variables from that file are applied when the app runs. They are not passed into the build job. This command has no `--replicas`, `--cpu-millicores`, or `--memory-mi` flag.

```bash
dflow apps:build APP [--repo URL | --path DIR] [--port N]
```

## Flags

`--repo` is an optional `https://github.com/` URL. `--path` is an optional local directory. The packed upload is at most 100MB. `.git`, `node_modules`, and `.env` are left out. Other files, including `.env.example`, are packed. Pass `--repo` or `--path`, not both.

`--port` is optional. `--wait` defaults to true. `--wait-timeout` defaults to `20m`, which is long enough for a build. `--timeout` is the same default. The usual global flags still apply.

## What you see

The terminal prints `id` and `status`. When the wait succeeds, and the document does not set `route.public` to false, the command also requests the platform hostname and prints `host`, `tls`, and `address`.

A `dflow.json` that fails the schema returns 400. The wait and the success rules match `dflow apps:deploy`.

## When it fails

A document with no `build.repo`, and no `--repo` on the command, exits 1 with `repo is required`.
