Skip to content

Commit a06f91f

Browse files
author
Alek99
committed
update
1 parent 7689877 commit a06f91f

File tree

2 files changed

+966
-1197
lines changed

2 files changed

+966
-1197
lines changed

docs/hosting/config_file.md

Lines changed: 38 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,21 @@ The `cloud.yml` file uses YAML format and supports the following structure. **Al
2424
# Basic deployment settings
2525
name: my-app-prod # Optional: defaults to project folder name
2626
description: 'Production deployment' # Optional: empty by default
27-
project: my-client-project # Optional: for organization
27+
projectname: my-client-project # Optional: defaults to personal project
2828

2929
# Infrastructure settings
3030
regions: # Optional: defaults to sjc: 1
31-
sjc: 1 # San Jose (primary)
32-
lhr: 2 # London (secondary)
31+
sjc: 1 # San Jose (# of machines)
32+
lhr: 2 # London (# of machines)
3333
vmtype: c2m2 # Optional: defaults to c1m1
3434

3535
# Custom domain and environment
36-
hostname: myapp.com # Optional: null uses default Reflex URL
36+
hostname: myapp # Optional: myapp.reflex.dev
3737
envfile: .env.production # Optional: defaults to .env
3838

3939
# Additional dependencies
4040
packages: # Optional: empty by default
4141
- procps
42-
- imagemagick
4342
```
4443
4544
## Configuration Options Reference
@@ -64,13 +63,16 @@ rx.table.root(
6463
align="center"
6564
) for option, type_, default, description, link in [
6665
("name", "string", "folder name", "Deployment identifier in dashboard", None),
67-
("description", "string", "empty", "Human-readable deployment description", None),
66+
("description", "string", "empty", "Description of deployment", None),
6867
("regions", "object", "sjc: 1", "Region deployment mapping", "/docs/hosting/regions"),
6968
("vmtype", "string", "c1m1", "Virtual machine specifications", "/docs/hosting/machine-types"),
70-
("hostname", "string", "null", "Custom domain configuration", "/docs/hosting/custom-domains"),
69+
("hostname", "string", "null", "Custom subdomain", None),
7170
("envfile", "string", ".env", "Environment variables file path", "/docs/hosting/secrets-environment-vars"),
72-
("project", "string", "null", "Project organization", None),
71+
("project", "uuid", "null", "Project uuid", None),
72+
("projectname", "string", "null", "Project name", None),
7373
("packages", "array", "empty", "Additional system packages", None),
74+
("include_db", "boolean", "false", "Include local sqlite", None),
75+
("strategy", "string", "auto", "Deployment strategy", None)
7476
]
7577
]),
7678
variant="ghost",
@@ -80,116 +82,60 @@ rx.table.root(
8082
)
8183
```
8284

83-
## Detailed Configuration Options
85+
## Configuration Options
8486

85-
### Regions
87+
For details of specific sections click the links in the table.
8688

87-
Available deployment regions with their codes:
88-
89-
- `sjc`: San Jose, California (US West)
90-
- `lhr`: London, United Kingdom (Europe)
91-
- `fra`: Frankfurt, Germany (Europe)
92-
- `syd`: Sydney, Australia (Asia-Pacific)
89+
### Projects
9390

94-
Specify regions using the format `region: instance_count`:
91+
Organize deployments using projects:
9592

9693
```yaml
97-
regions:
98-
sjc: 1 # Primary region with 1 instance
99-
lhr: 2 # Backup region with 2 instances for high availability
94+
projectname: client-alpha # Groups related deployments
10095
```
10196
102-
**Use Cases:**
103-
- Single region: Cost-effective for regional applications
104-
- Multi-region: Global applications requiring low latency and redundancy
105-
106-
### VM Types
107-
108-
Choose the appropriate virtual machine size based on your application needs:
109-
110-
### Custom Domains
111-
112-
Set `hostname` to use your own domain instead of the default Reflex Cloud URL:
113-
97+
You can also specify a project uuid instead of name:
11498
```yaml
115-
hostname: myapp.com
99+
project: 12345678-1234-1234-1234-1234567890ab
116100
```
117101
118-
**Requirements:**
119-
- Domain ownership verification
120-
- DNS configuration (CNAME or A record)
121-
- SSL certificate (handled automatically)
102+
You can go to the homepage of the project in the reflex cloud dashboard to find your project uuid in the url `https://cloud.reflex.dev/project/uuid`
122103

123-
### Environment Variables
104+
### Apt Packages
124105

125-
Specify the path to your environment variables file:
106+
Install additional system packages your application requires. Package names are based on the apt package manager:
126107

127108
```yaml
128-
envfile: .env.production # Custom environment file
129-
```
130-
131-
Example `.env` file structure:
132-
133-
```bash
134-
135-
DATABASE_URL=postgresql://user:pass@host:port/dbname
136-
137-
OPENAI_API_KEY=your_api_key_here
138-
STRIPE_SECRET_KEY=sk_live_...
139-
140-
DEBUG=False
141-
SECRET_KEY=your_secret_key_here
109+
packages:
110+
- procps=2.0.32-1 # Version pinning is optional
111+
- imagemagick
112+
- ffmpeg
142113
```
143114

144-
### Projects
115+
### Include SQLite
145116

146-
Organize deployments using projects:
117+
Include local sqlite database:
147118

148119
```yaml
149-
project: client-alpha # Groups related deployments
120+
include_db: true
150121
```
151122

152-
Projects help separate:
153-
- Different clients or customers
154-
- Development, staging, and production environments
155-
- Team-based application ownership
156-
157-
### Packages
158-
159-
Install additional system packages your application requires:
160-
161-
```yaml
162-
packages:
163-
- procps # Process monitoring tools
164-
- imagemagick # Image processing
165-
- ffmpeg # Media processing
166-
```
123+
This is not persistent and will be lost on restart. It is recommended to use a database service instead.
167124

168-
## Multiple Configuration Examples
125+
### Strategy
169126

170-
### Minimal Configuration
171-
```yaml
172-
# Uses all defaults - suitable for development
173-
name: my-app-dev
174-
```
127+
Deployment strategy:
128+
Available strategies:
129+
- `immediate`: [Default] Deploy immediately
130+
- `rolling`: Deploy in a rolling manner
131+
- `bluegreen`: Deploy in a blue-green manner
132+
- `canary`: Deploy in a canary manner, boot as single machine verify its health and then restart the rest.
175133

176-
### Production Configuration
177134
```yaml
178-
name: myapp-production
179-
description: 'Main production deployment'
180-
regions:
181-
sjc: 2
182-
lhr: 1
183-
vmtype: c4m4
184-
hostname: myapp.com
185-
envfile: .env.production
186-
project: myapp
187-
packages:
188-
- imagemagick
189-
- redis-tools
135+
strategy: immediate
190136
```
191137

192-
### Multi-Environment Setup
138+
## Multi-Environment Setup
193139

194140
**Development (`cloud-dev.yml`):**
195141
```yaml
@@ -217,12 +163,10 @@ regions:
217163
sjc: 2
218164
lhr: 1
219165
vmtype: c4m4
220-
hostname: myapp.com
166+
hostname: myapp
221167
envfile: .env.production
222168
```
223169

224-
## Using Different Configuration Files
225-
226170
Deploy with specific configuration files:
227171

228172
```bash
@@ -233,35 +177,3 @@ reflex deploy
233177
reflex deploy --config cloud-prod.yml
234178
reflex deploy --config cloud-staging.yml
235179
```
236-
237-
## Deployment Workflow
238-
239-
1. **Generate base configuration:**
240-
```bash
241-
reflex cloud config
242-
```
243-
244-
2. **Customize the `cloud.yml` file** based on your requirements using the options above
245-
246-
3. **Create environment file** (if needed):
247-
```bash
248-
touch .env
249-
# Add your environment variables
250-
```
251-
252-
4. **Deploy your application:**
253-
```bash
254-
reflex deploy
255-
```
256-
257-
5. **Monitor deployment** through the (Reflex Cloud)[https://cloud.reflex.dev/] dashboard
258-
259-
## Summary
260-
261-
The `cloud.yml` configuration provides complete control over your Reflex Cloud deployments while maintaining simplicity. All configuration options are optional, allowing you to start with minimal setup and gradually add complexity as your application scales.
262-
263-
Key takeaways:
264-
- Start with basic configuration and expand as needed
265-
- Use multiple configuration files for different environments
266-
- Leverage regions for global availability and redundancy
267-
- Secure environment variables and never commit them to version control

0 commit comments

Comments
 (0)