diff --git a/src/main/java/io/floci/cli/commands/StartCommand.java b/src/main/java/io/floci/cli/commands/StartCommand.java index 49ee46e..7189b0a 100644 --- a/src/main/java/io/floci/cli/commands/StartCommand.java +++ b/src/main/java/io/floci/cli/commands/StartCommand.java @@ -84,6 +84,9 @@ public class StartCommand implements Callable { args.addAll(DockerClient.dockerSocketRunArgs()); if (persistDir != null) { args.addAll(List.of("-v", persistDir + ":/app/data")); + // The server defaults to in-memory storage; enable persistent mode so + // state is actually written to the mounted directory and survives restarts. + args.addAll(List.of("-e", "FLOCI_STORAGE_MODE=persistent")); } if (services != null && !services.isBlank()) { args.addAll(List.of("-e", "FLOCI_SERVICES=" + services)); diff --git a/src/main/java/io/floci/cli/commands/az/AzStartCommand.java b/src/main/java/io/floci/cli/commands/az/AzStartCommand.java index a6ac25e..dca1a3e 100644 --- a/src/main/java/io/floci/cli/commands/az/AzStartCommand.java +++ b/src/main/java/io/floci/cli/commands/az/AzStartCommand.java @@ -79,6 +79,9 @@ public class AzStartCommand implements Callable { args.addAll(DockerClient.dockerSocketRunArgs()); if (persistDir != null) { args.addAll(List.of("-v", persistDir + ":/app/data")); + // The server defaults to in-memory storage; enable persistent mode so + // state is actually written to the mounted directory and survives restarts. + args.addAll(List.of("-e", "FLOCI_AZ_STORAGE_MODE=persistent")); } if (services != null && !services.isBlank()) { args.addAll(List.of("-e", "FLOCI_AZ_SERVICES=" + services)); diff --git a/src/main/java/io/floci/cli/commands/gcp/GcpStartCommand.java b/src/main/java/io/floci/cli/commands/gcp/GcpStartCommand.java index e8223ef..ec2038d 100644 --- a/src/main/java/io/floci/cli/commands/gcp/GcpStartCommand.java +++ b/src/main/java/io/floci/cli/commands/gcp/GcpStartCommand.java @@ -79,6 +79,9 @@ public class GcpStartCommand implements Callable { args.addAll(DockerClient.dockerSocketRunArgs()); if (persistDir != null) { args.addAll(List.of("-v", persistDir + ":/app/data")); + // The server defaults to in-memory storage; enable persistent mode so + // state is actually written to the mounted directory and survives restarts. + args.addAll(List.of("-e", "FLOCI_GCP_STORAGE_MODE=persistent")); } if (services != null && !services.isBlank()) { args.addAll(List.of("-e", "FLOCI_GCP_SERVICES=" + services));