mirror of
https://github.com/floci-io/floci-cli.git
synced 2026-11-22 21:50:47 -05:00
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:
1 parent
529d8578fb
commit
6af6ee096a
3 files changed
+9
No files matched your search
@@ -84,6 +84,9 @@ public class StartCommand 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_STORAGE_MODE=persistent"));
|
||||
}
|
||||
if (services != null && !services.isBlank()) {
|
||||
args.addAll(List.of("-e", "FLOCI_SERVICES=" + services));
|
||||
|
||||
@@ -79,6 +79,9 @@ public class AzStartCommand 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_AZ_STORAGE_MODE=persistent"));
|
||||
}
|
||||
if (services != null && !services.isBlank()) {
|
||||
args.addAll(List.of("-e", "FLOCI_AZ_SERVICES=" + services));
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user