fix(start): enable persistent storage mode when --persist is set (#9)

The server defaults to FLOCI_STORAGE_MODE=memory, so the --persist
bind mount to /app/data was a no-op: state was never written to disk
and did not survive a container restart.

Set FLOCI_STORAGE_MODE=persistent (per-cloud prefixed variant for GCP
and Azure) whenever --persist is provided, so emulator state is written
to the mounted host directory and survives restarts. Verified
end-to-end with S3 and DynamoDB across a stop --remove + start cycle.
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-06-21 09:50:48 -05:00
1 parent 529d8578fb
commit 6af6ee096a
3 files changed
+9

No files matched your search

@@ -79,6 +79,9 @@ public class GcpStartCommand implements Callable<Integer> {
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));