feat: add extra Docker networks to container config
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m23s
CI / docker (push) Successful in 1m7s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 38s

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:
hsiegeln
2026-04-12 16:53:01 +02:00
parent 5b6543b167
commit be96336974
4 changed files with 68 additions and 2 deletions

View File

@@ -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);

View File

@@ -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;