This repository contains Docker configurations for integrating Google Cloud Storage (GCS) with a FUSE filesystem using gcs-fuse. The demo folder is specifically for demonstrating the mounting of Kobo media files.
-
Google Cloud Service Account Key: Place your Google Cloud service account key file (e.g.,
sa-key.json) in thedemo/kobo/directory. -
Environment Variables: The
docker-compose.ymlfile indemo/kobo/uses environment variables directly. You can modify these values in thedocker-compose.ymlfile itself.GOOGLE_APPLICATION_CREDENTIALS: Path to your service account key within the container (e.g.,/keys/sa-key.json).BUCKET_NAME: The name of your GCS bucket.MOUNT_POINT: The directory inside the container where the GCS bucket will be mounted.GCSFUSE_UID: User ID for thegcsfuseprocess.GCSFUSE_GID: Group ID for thegcsfuseprocess.FILE_MODE: File permissions for mounted files.DIR_MODE: Directory permissions for mounted directories.MOUNTS: Optional multi-mount mode. Semicolon-separated entries in the formbucket=/mount/path;bucket-two=/mount/path-two. WhenMOUNTSis set,BUCKET_NAMEandMOUNT_POINTare ignored.
Navigate to the demo/kobo/ directory and run:
docker-compose upThis will build and start the gcsfuse service, mounting your specified GCS bucket to the MOUNT_POINT inside the container.
You can mount multiple buckets from one container by setting:
MOUNTS=bucket-one=/mnt/kpi;bucket-two=/mnt/kobocatIn that mode, bind mount each target path from the host into the container with shared propagation, for example:
volumes:
- ./sa-key.json:/keys/sa-key.json:ro
- /opt/kobo/data/kpi_media:/mnt/kpi:shared
- /opt/kobo/data/kobocat_media_uploads:/mnt/kobocat:shared