Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions website/learn/code/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,60 @@ hal9 deploy webapi --type flask
hal9 create webapi --type fastapi
hal9 deploy webapi --type fastapi
```

### Customize your application Hal9.yaml

Create Hal9.yaml file in your Hal9 application

#### Any app

`terminatems: <time-in-miliseconds>` set a pod living in the background for "x" time use this

#### Chatbot
`welcome: <welcome-message>` chatbot welcome message
`color: <hex-color>` chatbot color

### Deploy an Application from a Docker Image

You can deploy an application directly from a Docker image that exposes any API.

Your Docker image must include a root endpoint defined like:
```python
@app.get("/")
```
Hal9 uses this endpoint to verify that your application is healthy and running.

Applications deployed from Docker images meet the following conditions:

- The pod will always run in the background.

- Resource limits and requests are enforced automatically by Hal9.

- This feature is available only to Pro and Enterprise users.

#### Application Resource Limits (Top Limits)

Every Docker-based application can use up to the following maximum resources:

- CPU: Up to the power of one full processor

- Memory: Up to 4 GB of RAM

- Storage: Up to 10 GB of temporary working space

To deploy one, create a **hal9.yaml** file with the following content

```yaml
docker: <your-public-docker-image>
```
And then deploy with:
```sh
hal9 deploy . --name <your-app-name> --type docker
```
> Note:
> When deploying your application, make sure the application name does **not** include special characters or numbers. Use only lowercase letters and hyphens.

After deploying, you can access your application at:
```sh
hal9.com/<your-username>/<your-app-name>
```