Skip to content

Commit 452b582

Browse files
committed
fill out config.yaml docs
1 parent db7da3f commit 452b582

File tree

1 file changed

+94
-5
lines changed

1 file changed

+94
-5
lines changed

docs/hosting/config_file.md

Lines changed: 94 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
```python exec
22
import reflex as rx
33
from reflex_image_zoom import image_zoom
4-
from pcweb.pages.docs import hosting
4+
from pcweb.pages.docs import hosting
55
from pcweb.pages import docs
66
from pcweb.styles.styles import get_code_style, cell_style
77

88
```
9-
## Config File
9+
## What is reflex cloud config?
1010

11-
To create a `config.yml` file for your app run the command below:
11+
The following command:
1212

1313
```bash
1414
reflex cloud config
1515
```
1616

17-
This will create a yaml file similar to the one below where you can edit the app configuration:
17+
generates a `cloud.yml` configuration file used to deploy your Reflex app to the Reflex cloud platform. This file tells Reflex how and where to run your app in the cloud.
18+
19+
20+
## What does cloud.yml contain?
21+
22+
Here is an example cloud.yml file generated by the command:
1823

1924
```yaml
20-
name: medo
25+
name: default
2126
description: ''
2227
regions:
2328
sjc: 1
@@ -30,3 +35,87 @@ packages:
3035
- procps
3136
```
3237
38+
### Configuration Options Explained
39+
40+
**name**
41+
- Identifies your deployment in the Reflex Cloud dashboard
42+
- Use descriptive names like `myapp-prod` or `myapp-staging`
43+
44+
**description**
45+
- Optional but helpful for team collaboration
46+
- Document what this deployment is for
47+
48+
**regions**
49+
- Available regions: `sjc` (San Jose), `lhr` (London), `fra` (Frankfurt), `syd` (Sydney)
50+
- Format: `region: instance_count`
51+
- Use multiple regions for global availability and redundancy
52+
53+
**vmtype**
54+
- `c1m1`: 1 CPU, 1GB RAM (development/small apps)
55+
- `c2m2`: 2 CPU, 2GB RAM (production ready)
56+
- `c4m4`: 4 CPU, 4GB RAM (high traffic apps)
57+
- `c8m8`: 8 CPU, 8GB RAM (enterprise apps)
58+
59+
**hostname**
60+
- Leave as `null` for default Reflex Cloud URL
61+
- Set custom domain if you own one
62+
- Requires DNS configuration (see Custom Domains section)
63+
64+
**envfile**
65+
- Path to your environment variables file
66+
- Default is `.env` in your project root
67+
- Never commit this file to version control
68+
69+
**project**
70+
- Optional: organizes deployments within your account
71+
- Useful for separating client projects or environments
72+
73+
**packages**
74+
- Additional packages your app needs
75+
76+
### Environment Variables (Optional)
77+
78+
If your app uses environment variables, create a `.env` file in your project root:
79+
80+
```bash
81+
# Database
82+
DATABASE_URL=postgresql://user:pass@host:port/dbname
83+
84+
# API Keys
85+
OPENAI_API_KEY=your_api_key_here
86+
STRIPE_SECRET_KEY=sk_live_...
87+
88+
# App Configuration
89+
DEBUG=False
90+
SECRET_KEY=your_secret_key_here
91+
92+
# Custom Variables
93+
CUSTOM_API_ENDPOINT=https://api.example.com
94+
```
95+
96+
**Security Best Practices:**
97+
- Never commit `.env` to version control
98+
- Use different `.env` files for staging/production
99+
- Rotate secrets regularly
100+
- Use strong, unique values for SECRET_KEY
101+
102+
## How to use the cloud.yml
103+
104+
1. Run reflex cloud config to generate the default `cloud.yml` file.
105+
2. Open `cloud.yml` and customize the keys to fit your app and deployment preferences.
106+
3. Ensure your .env file (or specified envfile) contains the necessary environment variables for your app.
107+
4. Deploy your app using Reflex cloud commands (e.g., reflex deploy).
108+
109+
## Where to find values for keys?
110+
111+
- `regions`: Check Reflex cloud documentation or dashboard for region codes and availability.
112+
- `vmtype`: Check Reflex cloud VM size options to pick the right balance of CPU/memory.
113+
- `hostname`: Use your own domain name if you want a custom URL, or leave as null for default URLs.
114+
- `project`: Your Reflex cloud account projects — find them on the Reflex dashboard.
115+
- `packages`: Add any extra packages your app requires to run.
116+
117+
## Summary
118+
119+
Reflex Cloud provides a streamlined deployment experience for Python web applications. The `cloud.yml` configuration file gives you control over your deployment while maintaining simplicity. Start with basic configurations and scale up as your application grows.
120+
121+
For production applications, consider implementing proper monitoring, backup strategies, and CI/CD pipelines to ensure reliable deployments.

0 commit comments

Comments
 (0)