Skip to content

fix: Add SELF_HOSTING env variable to disable image optimization#2094

Open
kaigritun wants to merge 1 commit intotrycompai:mainfrom
kaigritun:fix/self-hosting-image-optimization
Open

fix: Add SELF_HOSTING env variable to disable image optimization#2094
kaigritun wants to merge 1 commit intotrycompai:mainfrom
kaigritun:fix/self-hosting-image-optimization

Conversation

@kaigritun
Copy link

Fixes #1467

Problem: Images were broken on self-hosted deployments because Next.js image optimization requires Vercel infrastructure.

Solution: Added SELF_HOSTING environment variable that disables Next.js image optimization when set to true.

Changes:

  • Added SELF_HOSTING env variable to env schema
  • Updated next.config.ts to set images.unoptimized based on SELF_HOSTING
  • Added SELF_HOSTING to .env.example with documentation
  • Updated SELF_HOSTING.md to include new required variable

Testing: Set SELF_HOSTING=true in apps/app/.env and verify images load correctly on risk and vendors pages.

- Added SELF_HOSTING environment variable to control Next.js image optimization
- When set to 'true', disables image optimization for self-hosted deployments
- Updated next.config.ts to use unoptimized images based on SELF_HOSTING
- Added SELF_HOSTING to .env.example with documentation
- Updated SELF_HOSTING.md to mention new required variable
- Updated env.mjs schema to validate SELF_HOSTING variable

Fixes trycompai#1467
@vercel
Copy link

vercel bot commented Feb 3, 2026

Someone is attempting to deploy a commit to the Comp AI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Kai Gritun seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[BUG] Image broken on SELF_HOSTING

2 participants