Skip to content

fix: install production dependencies and smoke test Docker images - #44

Merged
sv2dev merged 1 commit into
mainfrom
feature/docker-production-smoke-tests
Oct 30, 2026
Merged

sv2dev merged 1 commit into
mainfrom
feature/docker-production-smoke-tests

Conversation

@sv2dev

@sv2dev sv2dev commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Install locked production dependencies in Docker images and load Sharp at runtime.
  • Add production-container smoke tests to CI for /info and JPEG-to-WebP conversion.
  • Update Bun and dependency versions.

Testing

  • Build and typecheck passed.
  • All 46 tests passed.
  • Production-container smoke test passed for /info and JPEG-to-WebP conversion.
  • Confirmed no outdated workspace dependencies.

Summary by CodeRabbit

  • Chores
    • Updated Bun and image-processing package versions.
    • Container builds now install production packages and exclude repository metadata, build outputs, and dependency directories from the build context.
  • Tests
    • Added automated container checks for service availability and image processing, including WebP output.
    • Container checks now run in the build and publishing workflows.

- Add production container smoke tests to CI
- Update Bun and sharp versions
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The Docker image now uses Bun 1.4.4 and installs production dependencies from the frozen lockfile. A container smoke test checks the service information endpoint and image processing. CI runs the smoke test, and package configurations update Bun and sharp versions.

Changes

Container image build and validation

Layer / File(s) Summary
Container runtime dependencies and build context
package.json, packages/core/package.json, packages/server/package.json, .dockerignore, Dockerfile
sharp is now a production dependency, and its peer dependency range is updated. The server Docker build marks sharp as external. The Dockerfile uses Bun 1.4.4, copies packages, and installs production dependencies from the frozen lockfile. The Docker build context excludes .git, nested dependency and build directories, and *.tsbuildinfo files.
Container smoke test
scripts/container-smoke.sh, scripts/container-smoke.ts
The Bash script builds and starts the image, mounts fixtures read-only, runs the Bun smoke test, and logs and removes the container on exit. The test checks /info and submits a JPEG conversion request, then checks the response status, WebP data, and completion progress.
CI smoke-test and Bun version updates
.github/workflows/build-push.yaml, .github/workflows/test-build.yaml, packages/client/package.json, packages/server/package.json, packages/typebox/package.json
The Docker image workflow and a separate test workflow job run the smoke script. Workflow and package configurations update Bun-related versions to 1.4.4.

Priority: Not assessed

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant CI as CI runner
  participant SmokeScript as container-smoke.sh
  participant Docker as Docker container
  participant SmokeTest as container-smoke.ts
  participant Service as m4k service
  CI->>SmokeScript: Run container smoke test
  SmokeScript->>Docker: Build and start image with fixtures mounted
  SmokeScript->>SmokeTest: Execute test through Bun
  SmokeTest->>Service: Poll /info
  Service-->>SmokeTest: Return service information
  SmokeTest->>Service: POST JPEG conversion request
  Service-->>SmokeTest: Return WebP response and progress
Loading
Merge Risk: Moderate · up to 30348

This PR fixes the Docker image so production dependencies and Sharp load at runtime. As written, merging it will not publish the fixed image, because the server version is unchanged. Bump the server version or change the publish condition before merging, unless an unpublished image is intended.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the image flow,
Bun starts up, and tests can go.
A JPEG hops in, a WebP lands,
The container answers its commands.
CI watches, then stamps its paw.

Comment @coderabbitai help to get the list of available commands.

@sv2dev
sv2dev merged commit 85aa8f8 into main Oct 30, 2026
2 checks passed
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