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
Copy file name to clipboardExpand all lines: docs/deploystack/deploystack-config-file.md
+103Lines changed: 103 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,74 @@ v2-beta:
122
122
123
123
If no providers are excluded, templates will be generated for all supported cloud providers.
124
124
125
+
### Service Connections
126
+
127
+
You can configure service-to-service communication for multi-container applications using the `serviceConnections` property within each branch configuration. This feature is particularly useful for applications where services need to communicate with each other (e.g., web apps connecting to databases).
128
+
129
+
| Property | Type | Description | Constraints |
130
+
|----------|------|-------------|-------------|
131
+
| `mappings` | Array | Defines relationships between services for connection configuration | Required |
132
+
| `mappings[].fromService` | String | Service that needs to connect to another service | Required |
133
+
| `mappings[].toService` | String | Service being connected to | Required |
134
+
| `mappings[].environmentVariables` | Array of Strings | Environment variable names that reference the target service | Required |
135
+
136
+
Example configuration for service connections:
137
+
138
+
```yaml
139
+
deployment:
140
+
branches:
141
+
main:
142
+
label: "Production"
143
+
description: "Production release"
144
+
serviceConnections:
145
+
mappings:
146
+
- fromService: "app"
147
+
toService: "db"
148
+
environmentVariables:
149
+
- "DATABASE_HOST"
150
+
- "DATABASE_URL"
151
+
- fromService: "frontend"
152
+
toService: "api"
153
+
environmentVariables:
154
+
- "API_URL"
155
+
```
156
+
157
+
This configuration tells DeployStack how to properly configure communication between:
158
+
159
+
- The "app" service and the "db" service through the DATABASE_HOST and DATABASE_URL environment variables
160
+
- The "frontend" service and the "api" service through the API_URL environment variable
161
+
162
+
When templates are generated, DeployStack will transform these environment variables according to each cloud provider's specific service discovery mechanism:
163
+
164
+
- For Render.com: Uses Blueprint's `fromService` syntax
165
+
- For DigitalOcean App Platform: Uses direct service name references
166
+
167
+
For example, if your docker-compose.yml contains:
168
+
169
+
```yaml
170
+
services:
171
+
app:
172
+
image: node:alpine
173
+
environment:
174
+
DATABASE_HOST: db
175
+
db:
176
+
image: mariadb:latest
177
+
```
178
+
179
+
The generated Render.com template would transform DATABASE_HOST to use their service discovery syntax:
180
+
181
+
```yaml
182
+
services:
183
+
- name: app
184
+
# ...other configuration...
185
+
envVars:
186
+
- key: DATABASE_HOST
187
+
fromService:
188
+
name: db
189
+
type: pserv
190
+
property: hostport
191
+
```
192
+
125
193
## Schema Validation
126
194
127
195
The configuration file is automatically validated against our JSON Schema when using supported IDEs (VS Code, IntelliJ, etc.). The schema is available at:
0 commit comments