feat(storage): add private file layer and isolate SeaweedFS on a storage network
This commit is contained in:
1 parent
f5b07e8f4d
commit
8378ad45b0
22 files changed
+1668
-40
No files matched your search
@@ -63,6 +63,8 @@ services:
|
||||
networks:
|
||||
- observability
|
||||
- app
|
||||
# SeaweedFS metrics listen only on the storage network.
|
||||
- storage
|
||||
restart: unless-stopped
|
||||
logging:
|
||||
driver: json-file
|
||||
@@ -296,6 +298,9 @@ networks:
|
||||
app:
|
||||
name: ${APP_NETWORK:-app_default}
|
||||
external: true
|
||||
storage:
|
||||
name: ${APP_STORAGE_NETWORK:-${APP_PROJECT:-app}_storage}
|
||||
external: true
|
||||
observability:
|
||||
internal: true
|
||||
|
||||
|
||||
@@ -62,11 +62,30 @@ services:
|
||||
|
||||
seaweedfs:
|
||||
image: chrislusf/seaweedfs:latest
|
||||
# The storage network is the primary boundary: besides S3, mini serves
|
||||
# unauthenticated gRPC (master, filer, volume, S3), an admin server, and
|
||||
# HTTP APIs that ignore S3 credentials, so only the backend and the
|
||||
# monitoring Prometheus may join it. S3 requires the access key below;
|
||||
# -s3.iam=false only removes the IAM management API. As defense in depth,
|
||||
# each start sets fresh random JWT keys that never leave the container
|
||||
# (filer and volume HTTP requests need a token), and -whiteList limits
|
||||
# master and volume HTTP to in-container callers. "@" is the peer of the
|
||||
# local gRPC sockets that mini uses between its components.
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- -ec
|
||||
- |
|
||||
for name in WEED_JWT_SIGNING_KEY WEED_JWT_SIGNING_READ_KEY WEED_JWT_FILER_SIGNING_KEY WEED_JWT_FILER_SIGNING_READ_KEY; do
|
||||
export "$$name=$$(head -c 32 /dev/urandom | base64)"
|
||||
done
|
||||
exec /entrypoint.sh "$$@"
|
||||
- seaweedfs
|
||||
command:
|
||||
- mini
|
||||
- -dir=/data
|
||||
- -ip=seaweedfs
|
||||
- -ip=127.0.0.1
|
||||
- -ip.bind=0.0.0.0
|
||||
- -whiteList=127.0.0.1,@
|
||||
- -webdav=false
|
||||
- -admin.ui=false
|
||||
- -s3.iam=false
|
||||
@@ -82,6 +101,8 @@ services:
|
||||
S3_BUCKET: ${SEAWEEDFS_BUCKET:?Set SEAWEEDFS_BUCKET in the root .env file}
|
||||
volumes:
|
||||
- seaweedfs_data:/data
|
||||
networks:
|
||||
- storage
|
||||
expose:
|
||||
- "8333"
|
||||
- "9327"
|
||||
@@ -215,6 +236,9 @@ services:
|
||||
condition: service_healthy
|
||||
seaweedfs:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- default
|
||||
- storage
|
||||
expose:
|
||||
- "8080"
|
||||
- "9090"
|
||||
@@ -278,3 +302,7 @@ volumes:
|
||||
networks:
|
||||
default:
|
||||
name: ${APP_NETWORK:-app_default}
|
||||
# Only SeaweedFS, the backend, and the monitoring Prometheus join it.
|
||||
storage:
|
||||
name: ${APP_STORAGE_NETWORK:-${APP_PROJECT:-app}_storage}
|
||||
internal: true
|
||||
Reference in new issue
Block a user