fix(docker): drop dev tooling, git and libcurl from the runtime image #250
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github-actions
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Evobug/api!250
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/slim-api-image"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves the
apirow of the image vuln report (10 C / 74 H: OpenSSL, libcurl, Go 1.23 binary).Where the findings came from
esbuild0.25.10 (built with go1.23.12), pulled in bydrizzle-kit.tsgoandtsgolintare also Go binaries (go1.26). All three were in the image only because the Dockerfile installed devDependencies.apk add git. Nothing needs git (no submodules, no git deps).apk upgradeadded so future rebuilds pick up fixes between base-image releases.Changes
Dockerfile:bun install --production, drop git,apk upgrade.dockerignore(new): keep.git,.env*,node_modules, uploads, backups out ofCOPY . .scripts/migrate.ts(new): drizzle-orm runtime migrator, samedrizzle.__drizzle_migrationsjournal;migrate:productionnow runs it (previously pointed at a missing script).forgejo/workflows/deploy.yml+deploy/CHANGES.mdentry⚠️ Host action after deploy
In-container
bun run db:migrateno longer works (no drizzle-kit in the image). Use:Local dev keeps using
bun run db:migrate.Verification
drizzle-kit migratethenmigrate:productionon the same DB is a no-op; fresh DB viamigrate:productiongives an identicalpg_dump -sand the same 14 journal rows.tsgo --noEmitand oxlint pass.🤖 Generated with Claude Code
OpenCodeReview (
openai/gpt-5.6-luna) — 1 finding1 posted inline.
model
openai/gpt-5.6-luna· 5 file(s) reviewed · 417,770 tokens (392,214 in / 25,556 out / 339,975 cached — 87% of input) · 3m55s@ -0,0 +26,10 @@const db = drizzle({ client });try {const failure = await migrate(db, { migrationsFolder: new URL("../drizzle", import.meta.url).pathname });if (failure) {console.error("Migration failed:", failure);process.exitCode = 1;} else {console.log("Migrations applied");}[bug · medium]
drizzle-orm'smigrate()returnsPromise<void>and signals failures by throwing; it does not return a failure value. Therefore this condition is unreachable (and produces a TypeScript error if this script is type-checked), while migration errors bypass the intended message and become an unhandled exception. Catch the rejection instead.