Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

feat: officially support Docker named volumes for Native images (#155)

Dixit R Jain4fc9398df4a6
diff --git a/Dockerfile.native b/Dockerfile.native
index 6adf4de68e..0c84c7323b 100644
--- a/Dockerfile.native
+++ b/Dockerfile.native
@@ -16,7 +16,11 @@ RUN mvn clean package -Dnative -DskipTests -B
# Stage 2: Minimal runtime
FROM quay.io/quarkus/quarkus-micro-image:2.0
+USER root
WORKDIR /app
+RUN mkdir -p /app/data \
+ && chown -R 1001:root /app \
+ && chmod -R g+rwX /app
VOLUME /app/data
EXPOSE 4566
@@ -27,4 +31,5 @@ ENV FLOCI_VERSION=${VERSION}
COPY --from=build /app/target/*-runner /app/application
RUN chmod +x /app/application
+USER 1001
ENTRYPOINT ["/app/application"]
diff --git a/Dockerfile.native-package b/Dockerfile.native-package
index 3590ee36d6..10e608125d 100644
--- a/Dockerfile.native-package
+++ b/Dockerfile.native-package
@@ -7,11 +7,11 @@ ENV FLOCI_VERSION=${VERSION}
WORKDIR /app
-VOLUME /app/data
+RUN mkdir -p /app/data \
+ && chown -R 1001:root /app \
+ && chmod -R g+rwX /app
-RUN chown 1001 /app \
- && chmod "g+rwX" /app \
- && chown 1001:root /app
+VOLUME /app/data
COPY --chown=1001:root target/*.properties target/*.so /app/
COPY --chown=1001:root target/*-runner /app/application
diff --git a/README.md b/README.md
index d69392aad5..61ce8bd243 100644
--- a/README.md
+++ b/README.md
@@ -128,7 +128,14 @@ services:
ports:
- "4566:4566"
volumes:
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
+
+#volumes:
+# floci-data:
```
```bash
diff --git a/docs/configuration/docker-compose.md b/docs/configuration/docker-compose.md
index 15f160885c..bb074dbf1e 100644
--- a/docs/configuration/docker-compose.md
+++ b/docs/configuration/docker-compose.md
@@ -11,9 +11,16 @@ services:
ports:
- "4566:4566"
volumes:
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
- ./init/start.d:/etc/floci/init/start.d:ro
- ./init/stop.d:/etc/floci/init/stop.d:ro
+
+#volumes:
+# floci-data:
```
## Full Setup (with ElastiCache and RDS)
@@ -29,10 +36,17 @@ services:
- "6379-6399:6379-6399" # ElastiCache / Redis proxy ports
- "7001-7099:7001-7099" # RDS / PostgreSQL + MySQL proxy ports
volumes:
- - /var/run/docker.sock:/var/run/docker.sock # required for Lambda, ElastiCache, RDS
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
+ - /var/run/docker.sock:/var/run/docker.sock # required for Lambda, ElastiCache, RDS
environment:
FLOCI_SERVICES_DOCKER_NETWORK: my-project_default # (1)
+
+#volumes:
+# floci-data:
```
1. Set this to the Docker network name that your compose project creates (usually `<project-name>_default`). Floci uses it to attach spawned Lambda / ElastiCache / RDS containers to the same network.
@@ -68,10 +82,17 @@ services:
ports:
- "4566:4566"
volumes:
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
environment:
FLOCI_STORAGE_MODE: persistent
FLOCI_STORAGE_PERSISTENT_PATH: /app/data
+
+#volumes:
+# floci-data:
```
## Environment Variables Reference
diff --git a/docs/getting-started/quick-start.md b/docs/getting-started/quick-start.md
index 85fc98beb5..845ce90023 100644
--- a/docs/getting-started/quick-start.md
+++ b/docs/getting-started/quick-start.md
@@ -15,7 +15,14 @@ This guide gets Floci running and verifies that AWS CLI commands work against it
ports:
- "4566:4566"
volumes:
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
+
+# volumes:
+# floci-data:
```
```bash
@@ -33,7 +40,14 @@ This guide gets Floci running and verifies that AWS CLI commands work against it
ports:
- "4566:4566"
volumes:
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
+
+# volumes:
+# floci-data:
```
```bash
diff --git a/docs/index.md b/docs/index.md
index 5ae2397aac..af025b06bf 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -53,7 +53,14 @@ services:
ports:
- "4566:4566"
volumes:
+ # Local directory bind mount (default)
- ./data:/app/data
+
+ # OR named volume (optional):
+ # - floci-data:/app/data
+
+#volumes:
+# floci-data:
```
```bash