Repository navigation
Run icemap.app on Bun instead of Node + pnpm - #8
Merged
Merged
Conversation
- Image: oven/bun:1.4.0-slim, `bun apps/web/server.js` (Next standalone), same Dockerfile path dev2's compose builds; ffmpeg + ImageMagick 7 from Debian for media uploads. Declares the two NEXT_PUBLIC_* build args dev2 passes; adds a HEALTHCHECK. - Bun workspaces replace pnpm-workspace.yaml; bun.lock migrated from pnpm-lock.yaml with every version kept. Hoisted linker so the Socket patch postinstall still finds fast-xml-parser. - next.config pins outputFileTracingRoot to the workspace root. - CI: lint, typecheck, bun test, build, boot the standalone server under Bun and render /_next/image (sharp); bun audit (non-blocking). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan3 finding(s) HIGH/CRITICAL: 1 | LOW: 2
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Part of the fleet Node -> Bun migration.
What changes
apps/web/Dockerfile, the path dev2's compose builds): deps and build onoven/bun:1.4.0-alpine; runtime isalpine:3.24with Bun's musl binary copied in, so/api/media/uploadkeeps exactly the ffmpeg 8.1.2 and ImageMagick 7.1.2 prod runs today (oven/bun:*-alpineis Alpine 3.22 with ffmpeg 6.1; Debian slim doubled the image to 1 GB). Runsbun apps/web/server.js(Next standalone) as uid 1000, adds a HEALTHCHECK, and declares the twoNEXT_PUBLIC_*build args dev2 passes (the three Railway-era ones stay declared).pnpm-workspace.yaml.bun.lockis migrated frompnpm-lock.yaml, and all 740 package versions match.bunfig.tomluses the hoisted linker so the Socket patch postinstall still findsfast-xml-parser, which it cannot do in Bun's isolated layout. The image installs with--ignore-scripts: socket-patch has no musl build and the image never had.socket/anyway, bcrypt ships a musl prebuild, and sharp, esbuild and unrs-resolver use platform packages.next.config.tspinsoutputFileTracingRootto the workspace root.ci.yml): lint, typecheck,bun test, build, boot the standalone server under Bun and render/_next/image(sharp).bun auditruns as a non-blocking job. The first test (src/lib/time.test.ts) is written withnode:test.Verified from the commit
I built the image from
git archive HEADwith a compose file shaped like dev2's (same build args, env_file, 1 GiB limit) and compared it with https://icemap.app:/api/posts/recent,/api/posts/nearby(PostGIS rpc),/api/donate/coins, the post and comments APIs,/sw.js,/manifest.jsonand the Supabase storage proxy/api/media/...(including a 206 range request) are byte-identical./_next/imageoutput is byte-identical for both a public PNG and a storage JPEG, so sharp works under Bun.magickandffmpegcommands run through Bun'schild_process.execand produce 1440x1080 JPEG and H.264 Main 1280x720 + AAC. A 20 MB multipart body is parsed and rejected with 400.healthy,docker stoptook 0.5 s, the logs are clean, and the container used 57 MiB at idle. The image is 431 MB, down from 522 MB.deploy-dev2.ymlis untouched.🤖 Generated with Claude Code