Skip to content

Run the full app locally with Docker Compose and local S3 - #126

Open
jh0ker wants to merge 5 commits into
dev/local-backendfrom
dev/local-stack
Open

jh0ker wants to merge 5 commits into
dev/local-backendfrom
dev/local-stack

Conversation

@jh0ker

@jh0ker jh0ker commented Oct 6, 2026

Copy link
Copy Markdown
Member

docker compose up now runs the whole app locally, with a local S3 service instead of the AWS dev bucket.

  • Services: frontend, backend and a pinned SeaweedFS S3 service. storage-seed creates the code4maus-local bucket, configures CORS and public reads under data/, and uploads missing project media. No AWS credentials or ~/.aws mount are needed.

  • Env defaults: .env.example and .env.backend.example default to this local setup. Running against the deployed dev stage is documented in CONTRIBUTING.md.

  • Storage endpoints: the backend uses STORAGE_ENDPOINT for its own storage access and signs browser uploads for STORAGE_ENDPOINT_FRONTEND (localhost).

  • Asset scripts: yarn assets:download|check|upload replace the aws s3 sync scripts and extract-assets.js:

    • download fetches missing media from a deployed site into assets/runtime/.
    • check compares that folder against what the checkout references.
    • upload publishes only missing files to a bucket's data/assets/ and never overwrites anything.

    yarn test:assets covers them.

  • Volumes: only node_modules and the storage data are named volumes. Volumes mounted inside the bind-mounted checkout made Docker create root-owned .cache/ and build/ directories on the host, which broke host builds and git checkouts. The dev server builds in memory only (static: false).

  • .cache/: the old MinIO data in .cache/ is no longer tracked.

  • Deployment docs: cdk/DEPLOYMENT.md now uses the asset scripts to fill a new stage's bucket. The assets/ prefix in the old note is a leftover from before 876ae9f (2018). The app only reads data/assets/, and CloudFront only routes data/* to the project bucket.

Tested: docker compose up from a fresh checkout. Pages, /data from the local bucket and /api (including presigned uploads) all work, and the checkout has no root-owned files afterwards. yarn test:assets (8 tests).

@jh0ker
jh0ker added this pull request to stack #127 October 6, 2026 15:37
@netlify

netlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for serene-narwhal-9b7b1c ready!

Name Link
🔨 Latest commit 9b86add
🔍 Latest deploy log https://app.netlify.com/projects/serene-narwhal-9b7b1c/deploys/6ac62e100016eb00089334de
😎 Deploy Preview https://deploy-preview-126--serene-narwhal-9b7b1c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for peaceful-raindrop-cb2462 ready!

Name Link
🔨 Latest commit 9b86add
🔍 Latest deploy log https://app.netlify.com/projects/peaceful-raindrop-cb2462/deploys/6ac62e108c73ed0008e7bdf7
😎 Deploy Preview https://deploy-preview-126--peaceful-raindrop-cb2462.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jh0ker
jh0ker force-pushed the dev/local-stack branch 2 times, most recently from d49b122 to f8f6aef Compare October 6, 2026 16:20
@jh0ker
jh0ker force-pushed the dev/local-stack branch 2 times, most recently from e48b589 to 6f69834 Compare October 7, 2026 11:28
jh0ker added 5 commits October 7, 2026 13:33
Runs both front- and backend, but still using the dev bucket in AWS for now
The bucket-level assets/ prefix is a leftover from uploads before
876ae9f (2018) moved them to data/assets/. The app only reads
/data/assets/ and CloudFront only routes data/* to the project bucket.
@jh0ker
jh0ker marked this pull request as ready for review October 7, 2026 11:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant