You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,8 +4,8 @@ from reflex_image_zoom import image_zoom
4
4
from pcweb.pages.docs import hosting
5
5
from pcweb.pages import docs
6
6
from pcweb.styles.styles import get_code_style, cell_style
7
-
8
7
```
8
+
9
9
## What is reflex cloud config?
10
10
11
11
The following command:
@@ -16,106 +16,252 @@ reflex cloud config
16
16
17
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
18
19
+
## Configuration File Structure
20
+
21
+
The `cloud.yml` file uses YAML format and supports the following structure. **All fields are optional** and will use sensible defaults if not specified:
22
+
23
+
```yaml
24
+
# Basic deployment settings
25
+
name: my-app-prod # Optional: defaults to project folder name
26
+
description: 'Production deployment'# Optional: empty by default
27
+
project: my-client-project # Optional: for organization
project: client-alpha # Groups related deployments
150
+
```
151
+
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:
91
160
92
-
# Custom Variables
93
-
CUSTOM_API_ENDPOINT=https://api.example.com
161
+
```yaml
162
+
packages:
163
+
- procps # Process monitoring tools
164
+
- imagemagick # Image processing
165
+
- ffmpeg # Media processing
166
+
```
167
+
168
+
## Multiple Configuration Examples
169
+
170
+
### Minimal Configuration
171
+
```yaml
172
+
# Uses all defaults - suitable for development
173
+
name: my-app-dev
174
+
```
175
+
176
+
### Production Configuration
177
+
```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
190
+
```
191
+
192
+
### Multi-Environment Setup
193
+
194
+
**Development (`cloud-dev.yml`):**
195
+
```yaml
196
+
name: myapp-dev
197
+
description: 'Development environment'
198
+
vmtype: c1m1
199
+
envfile: .env.development
94
200
```
95
201
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
202
+
**Staging (`cloud-staging.yml`):**
203
+
```yaml
204
+
name: myapp-staging
205
+
description: 'Staging environment'
206
+
regions:
207
+
sjc: 1
208
+
vmtype: c2m2
209
+
envfile: .env.staging
210
+
```
211
+
212
+
**Production (`cloud-prod.yml`):**
213
+
```yaml
214
+
name: myapp-production
215
+
description: 'Production environment'
216
+
regions:
217
+
sjc: 2
218
+
lhr: 1
219
+
vmtype: c4m4
220
+
hostname: myapp.com
221
+
envfile: .env.production
222
+
```
223
+
224
+
## Using Different Configuration Files
225
+
226
+
Deploy with specific configuration files:
227
+
228
+
```bash
229
+
# Use default cloud.yml
230
+
reflex deploy
231
+
232
+
# Use specific configuration file
233
+
reflex deploy --config cloud-prod.yml
234
+
reflex deploy --config cloud-staging.yml
235
+
```
236
+
237
+
## Deployment Workflow
238
+
239
+
1. **Generate base configuration:**
240
+
```bash
241
+
reflex cloud config
242
+
```
101
243
102
-
## How to use the cloud.yml
244
+
2. **Customize the `cloud.yml` file** based on your requirements using the options above
103
245
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).
246
+
3. **Create environment file** (if needed):
247
+
```bash
248
+
touch .env
249
+
# Add your environment variables
250
+
```
108
251
109
-
## Where to find values for keys?
252
+
4. **Deploy your application:**
253
+
```bash
254
+
reflex deploy
255
+
```
110
256
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.
257
+
5. **Monitor deployment** through the (Reflex Cloud)[https://cloud.reflex.dev/] dashboard
116
258
117
259
## Summary
118
260
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.
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.
120
262
121
-
For production applications, consider implementing proper monitoring, backup strategies, and CI/CD pipelines to ensure reliable deployments.
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