feat(infra): provision MinIO object storage for local S3-compatible dev#250
Open
Zeemnew wants to merge 1 commit into
Open
feat(infra): provision MinIO object storage for local S3-compatible dev#250Zeemnew wants to merge 1 commit into
Zeemnew wants to merge 1 commit into
Conversation
Add MinIO to docker-compose with private bucket bootstrap, wire backend OBJECT_STORE_* env config, and implement a shared S3 client path for MinIO, AWS S3, and Cloudflare R2. Closes codebestia#223
|
@Zeemnew Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR provisions S3-compatible object storage for local development by adding MinIO to
infra/docker-compose.ymland wiring the backend to read storage configuration from environment variables. The same S3 client code path works against local MinIO, AWS S3, and Cloudflare R2 by changing env values only.Related Issue
Closes #223
Changes
🐳 Infrastructure
infra/docker-compose.ymlminioservice exposing the S3 API on port9000and console on9001.minio-initsidecar that creates theclickedbucket on startup with a private ACL (mc anonymous set none).minio_datavolume.⚙️ Backend Object Storage
[ADD]
apps/backend/src/lib/objectStore.tsAdded an S3-compatible
ObjectStorewrapper using@aws-sdk/client-s3.Configured the client from
OBJECT_STORE_*env vars with support for custom endpoints and path-style addressing.Exposed
putObject,getObject,deleteObject, andensureBucketReachablehelpers.[MODIFY]
apps/backend/src/config.tsAdded required env validation for:
OBJECT_STORE_ENDPOINTOBJECT_STORE_BUCKETOBJECT_STORE_ACCESS_KEYOBJECT_STORE_SECRET_KEYOBJECT_STORE_REGIONOBJECT_STORE_FORCE_PATH_STYLE[MODIFY]
apps/backend/src/index.tsBootstraps the object store from validated env and checks bucket reachability on startup.
🧪 Tests
[ADD]
apps/backend/src/__tests__/objectStore.test.tsAdded coverage for S3 client configuration (MinIO path-style and AWS/R2 virtual-hosted style).
Added coverage for bucket reachability checks and object put/get/delete operations.
[MODIFY]
apps/backend/src/__tests__/config.test.tsAdded coverage for new
OBJECT_STORE_*env parsing and boolean coercion forOBJECT_STORE_FORCE_PATH_STYLE.[MODIFY]
apps/backend/src/__tests__/setup.tsSeeded test env defaults for object storage configuration.
🔧 Configuration
.env.exampledocker-compose.yml.apps/backend/package.json/pnpm-lock.yaml@aws-sdk/client-s3dependency.Verification Results
docker compose upbrings up MinIO with a private bucketminio+minio-init)