Uh oh!
There was an error while loading. Please reload this page.
feat: optimized multi-stage docker images (93% smaller) [WIP] - #359
feat: optimized multi-stage docker images (93% smaller) [WIP]#359adiologydev wants to merge 12 commits into
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@adiologydev is attempting to deploy a commit to the Sim Studio Team on Vercel. A member of the Team first needs to authorize it. |
…ove legacy Dockerfile and entrypoint script
There was a problem hiding this comment.
PR Summary
This PR significantly optimizes Docker images through multi-stage builds and runtime environment configuration, reducing image size by 93%. The changes span across multiple files to support containerized deployment. - New multi-stage app.Dockerfile and db.Dockerfile using Bun runtime and Alpine Linux base for minimal image size - Modified env.ts to use next-runtime-env for dynamic environment variable handling, making the app more deployment-agnostic - Added DOCKER_BUILD environment flag to bypass waitlist protection and modify build configurations in self-hosted environments - Removed migration #29 from _journal.json which could impact database consistency across environments - Changed S3 client initialization from eager to lazy loading using getS3Client() factory pattern
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
40 file(s) reviewed, 24 comment(s)
Edit PR Review Bot Settings | Greptile
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| # Copy only package files needed for migrations | ||
| COPY package.json bun.lock turbo.json ./ | ||
| COPY apps/sim/package.json ./apps/sim/db/ |
There was a problem hiding this comment.
logic: Incorrect destination path for package.json. Should be ./apps/sim/ instead of ./apps/sim/db/ since the package.json is needed at the app root
| COPY apps/sim/package.json ./apps/sim/db/ | |
| COPY apps/sim/package.json ./apps/sim/ |
| RUN bun install --omit dev --ignore-scripts && \ | ||
| bun install --omit dev --ignore-scripts drizzle-kit drizzle-orm postgres next-runtime-env |
There was a problem hiding this comment.
logic: Second bun install command will overwrite dependencies from first install. Combine into single command with all packages
| RUN bun install --omit dev --ignore-scripts && \ | |
| bun install --omit dev --ignore-scripts drizzle-kit drizzle-orm postgres next-runtime-env | |
| RUN bun install --omit dev --ignore-scripts drizzle-kit drizzle-orm postgres next-runtime-env |
| COPY apps/sim/package.json ./apps/sim/package.json | ||
| COPY apps/sim/lib/env.ts ./apps/sim/lib/env.ts | ||
| WORKDIR /app/apps/sim No newline at end of file |
There was a problem hiding this comment.
logic: Missing CMD or ENTRYPOINT instruction to specify how to run database migrations
| # ======================================== | ||
| # Dependencies Stage: Install Dependencies | ||
| # ======================================== | ||
| FROM oven/bun:alpine AS deps |
There was a problem hiding this comment.
style: Consider pinning to specific Bun version instead of using latest alpine for reproducible builds
Uh oh!
There was an error while loading. Please reload this page.
… and implement GitHub Actions for Docker image build and publish
…I routes and maintain dynamic rendering
waleedlatif1
commented
May 18, 2025
merged in #371 |
Description
This PR optimizes sim's publishable image to just 93% of the original size. It now uses runtime environment variables to be truly agnostic and letting users skip the self-building step.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Checklist:
npm test)Security Considerations:
Additional Information:
Next Steps: