When working on the S3 filestore features, a developer needs a local S3 service. Here we document two approaches.
Minio-based local S3 storage
Add to docker-compose.override.yaml:
x-common-dev: &x-common
...
environment:
FILESTORE_HOST: filestore
FILESTORE_PORT: 9000
FILESTORE_PROTOCOL: http
FILESTORE_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
FILESTORE_SECRET_KEY: ${FILESTORE_SECRET_KEY}
FILESTORE_BUCKET_NAME: ${FILESTORE_BUCKET_NAME:-bluespice}
FILESTORE_REGION: ${FILESTORE_REGION:-eu-north-1}
...
filestore:
image: minio/minio:latest
container_name: ${COMPOSE_PROJECT_NAME:-bluespice}-filestore
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${FILESTORE_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${FILESTORE_SECRET_KEY}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ${DATADIR}/filestore:/data
restart: no
In .env, add
FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1
Before starting the full stack:
- create the
$DATADIR/filestoredirectory manually- change its ownership to
0:0
- change its ownership to
- run
./bluespice-deploy up -d filestore- access the MINIO webinterface in your browser at
http://localhost:9001 - Use the values of
FILESTORE_ACCESS_KEYandFILESTORE_SECRET_KEYto log in. - You will need to manually create a bucket with the name of
FILESTORE_BUCKET_NAME.
- access the MINIO webinterface in your browser at
Then you can start the full stack with ./bluespice-deploy up -d filestore.
Garage-based local S3 storage
Add to docker-compose.override.yaml:
x-common-dev: &x-common
environment:
FILESTORE_HOST: filestore
FILESTORE_PORT: 9000
FILESTORE_PROTOCOL: http
FILESTORE_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
FILESTORE_SECRET_KEY: ${FILESTORE_SECRET_KEY}
FILESTORE_BUCKET_NAME: ${FILESTORE_BUCKET_NAME:-bluespice}
FILESTORE_REGION: ${FILESTORE_REGION:-eu-north-1}
services:
wiki-installer:
<<: *x-common
wiki-web:
<<: *x-common
restart: no
wiki-task:
<<: *x-common
restart: no
filestore:
image: dxflrs/garage:v2.3.0
container_name: ${COMPOSE_PROJECT_NAME:-bluespice}-filestore
command: /garage server --single-node --default-bucket
environment:
GARAGE_CONFIG_FILE: /etc/garage.toml
# 32-byte-hex, e.g. openssl rand -hex 32
GARAGE_RPC_SECRET: 8af47171e8a9c2d5147e885c84d2c63fe70616a3611518ddc1a6b516beb9dcd5
GARAGE_DEFAULT_ACCESS_KEY: ${FILESTORE_ACCESS_KEY}
GARAGE_DEFAULT_SECRET_KEY: ${FILESTORE_SECRET_KEY}
GARAGE_DEFAULT_BUCKET: ${FILESTORE_BUCKET_NAME:-bluespice}
ports:
- "9000:9000"
- "3903:3903"
volumes:
- ${DATADIR}/filestore/meta:/var/lib/garage/meta
- ${DATADIR}/filestore/data:/var/lib/garage/data
configs:
- source: garage_toml
target: /etc/garage.toml
mode: 0444
restart: no
configs:
garage_toml:
content: |
metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "sqlite"
replication_factor = 1
rpc_bind_addr = "0.0.0.0:3901"
rpc_public_addr = "filestore:3901"
[s3_api]
api_bind_addr = "0.0.0.0:9000"
s3_region = "eu-north-1"
[admin]
api_bind_addr = "0.0.0.0:3903"
Similarly in .env, add
FILESTORE_ACCESS_KEY=...
FILESTORE_SECRET_KEY=...
FILESTORE_BUCKET_NAME=bluespice
FILESTORE_REGION=eu-north-1
Then you can start the full stack with ./bluespice-deploy up -d filestore.