feat: add extra Docker networks to container config
Apps can now join additional Docker networks (e.g., monitoring, prometheus) configured via containerConfig.extraNetworks. Flows through the 3-layer config merge. Networks are created if absent and containers are connected during deployment. UI adds a pill-list field on the Resources tab (both create and edit views). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,8 @@ public final class ConfigMerger {
|
||||
boolVal(appConfig, envConfig, "routeControlEnabled", true),
|
||||
boolVal(appConfig, envConfig, "replayEnabled", true),
|
||||
stringVal(appConfig, envConfig, "runtimeType", "auto"),
|
||||
stringVal(appConfig, envConfig, "customArgs", "")
|
||||
stringVal(appConfig, envConfig, "customArgs", ""),
|
||||
stringList(appConfig, envConfig, "extraNetworks")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,6 +79,17 @@ public final class ConfigMerger {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
private static List<String> stringList(Map<String, Object> app, Map<String, Object> env, String key) {
|
||||
Object val = app.containsKey(key) ? app.get(key) : env.get(key);
|
||||
if (val instanceof List<?> list) {
|
||||
return list.stream()
|
||||
.filter(String.class::isInstance)
|
||||
.map(String.class::cast)
|
||||
.toList();
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static Map<String, String> stringMap(Map<String, Object> app, Map<String, Object> env, String key) {
|
||||
Object val = app.containsKey(key) ? app.get(key) : env.get(key);
|
||||
|
||||
@@ -21,7 +21,8 @@ public record ResolvedContainerConfig(
|
||||
boolean routeControlEnabled,
|
||||
boolean replayEnabled,
|
||||
String runtimeType,
|
||||
String customArgs
|
||||
String customArgs,
|
||||
List<String> extraNetworks
|
||||
) {
|
||||
public long memoryLimitBytes() {
|
||||
return (long) memoryLimitMb * 1024 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user