diff --git a/docker/docker-compose.rustfs.yml b/docker/docker-compose.rustfs.yml new file mode 100644 index 00000000000..31a24b15de3 --- /dev/null +++ b/docker/docker-compose.rustfs.yml @@ -0,0 +1,88 @@ +services: + + rustfs: + image: rustfs/rustfs + environment: + RUSTFS_ACCESS_KEY: ${MINIO_ROOT_USER} + RUSTFS_SECRET_KEY: ${MINIO_ROOT_PASSWORD} + RUSTFS_CONSOLE_ADDRESS: 0.0.0.0:9001 + RUSTFS_CORS_ALLOWED_ORIGINS: "*" + RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS: "*" + security_opt: + - "no-new-privileges:true" + healthcheck: + test: [ "CMD", "curl", "-f", "http://rustfs:9000/health" ] + interval: 2s + timeout: 10s + retries: 5 + volumes: + - ./volumes/storage:/data:z + + rustfs-createbucket: + image: rustfs/rc + depends_on: + rustfs: + condition: service_healthy + entrypoint: > + /bin/sh -ec " + rc alias set supa-rustfs http://rustfs:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} && + rc mb --ignore-existing supa-rustfs/${GLOBAL_S3_BUCKET} + " + + storage: + container_name: supabase-storage + image: supabase/storage-api:v1.37.8 + restart: unless-stopped + depends_on: + db: + # Disable this if you are using an external Postgres database + condition: service_healthy + rest: + condition: service_started + imgproxy: + condition: service_started + rustfs-createbucket: + condition: service_completed_successfully + rustfs: + condition: service_healthy + healthcheck: + test: + [ + "CMD", + "wget", + "--no-verbose", + "--tries=1", + "--spider", + "http://storage:5000/status" + ] + timeout: 5s + interval: 5s + retries: 3 + environment: + ANON_KEY: ${ANON_KEY} + SERVICE_KEY: ${SERVICE_ROLE_KEY} + POSTGREST_URL: http://rest:3000 + PGRST_JWT_SECRET: ${JWT_SECRET} + DATABASE_URL: postgres://supabase_storage_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} + REQUEST_ALLOW_X_FORWARDED_PATH: "true" + FILE_SIZE_LIMIT: 52428800 + STORAGE_BACKEND: s3 + # S3 bucket when using S3 backend, directory name when using 'file' + GLOBAL_S3_BUCKET: ${GLOBAL_S3_BUCKET} + # S3 Backend configuration + GLOBAL_S3_ENDPOINT: http://rustfs:9000 + GLOBAL_S3_PROTOCOL: http + GLOBAL_S3_FORCE_PATH_STYLE: true + AWS_ACCESS_KEY_ID: ${MINIO_ROOT_USER} + AWS_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD} + #FILE_STORAGE_BACKEND_PATH: /var/lib/storage + TENANT_ID: ${STORAGE_TENANT_ID} + # TODO: https://github.com/supabase/storage-api/issues/55 + REGION: ${REGION} + ENABLE_IMAGE_TRANSFORMATION: "true" + IMGPROXY_URL: http://imgproxy:5001 + # S3 protocol endpoint configuration + S3_PROTOCOL_ACCESS_KEY_ID: ${S3_PROTOCOL_ACCESS_KEY_ID} + S3_PROTOCOL_ACCESS_KEY_SECRET: ${S3_PROTOCOL_ACCESS_KEY_SECRET} + #volumes: + # - ./volumes/storage:/var/lib/storage:z