[PR #27704] FIX Issue #27697: Add env variable in docker-compose(template) and make it take effect. #31836

Closed
opened 2026-02-21 20:50:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/27704

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Related Issues and PRs

Summary

This PR adds the missing environment variable NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX to the web service in docker/docker-compose-template.yaml#L104.

According to PR #27070, this variable NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX controls whether inline LaTeX formulas (e.g., E=mc^2) should be rendered in the frontend. However, it was not included in the environment section (shown as docker/docker-compose-template.yaml#L81-L103), causing .env settings to have no effect when deploying with Docker.

Reason / Problem

  • Inline formulas were not rendered when deploying via Docker (main branch).
  • The environment variable NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX defined in .env was ignored.

Solution

By explicitly adding the environment variable to the web service, the frontend build process now recognizes NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX, allowing inline formulas to render properly.

Changes

NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX: ${NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX:-false}

Screenshots

Before After
508053885-bb56a9f4-4d86-49b8-b3f8-c47e4d7f23a8 508057944-08461f79-21da-43eb-94e8-04c6088ee9a3

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/27704 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Related Issues and PRs - to fix https://github.com/langgenius/dify/issues/27697 - (Related) [PR #27070](https://github.com/langgenius/dify/pull/27070) ## Summary This PR adds the missing environment variable `NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX` to the `web` service in [`docker/docker-compose-template.yaml#L104`](https://github.com/Dave0126/dify/blob/10e33774a1ff67c54f9de96fe87f803da4c899a8/docker/docker-compose-template.yaml#L104). According to [PR #27070](https://github.com/langgenius/dify/pull/27070), this variable `NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX` controls whether inline LaTeX formulas (e.g., $E=mc^2$) should be rendered in the frontend. However, it was not included in the `environment` section (shown as [docker/docker-compose-template.yaml#L81-L103](https://github.com/langgenius/dify/blob/f7f6b4a8b0029dfd57cb7f3ef1e59f7cb5f09003/docker/docker-compose-template.yaml#L81-L103)), causing `.env` settings to have no effect when deploying with Docker. ## Reason / Problem - Inline formulas were not rendered when deploying via `Docker` (`main` branch). - The environment variable `NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX` defined in `.env` was ignored. ## Solution By explicitly adding the environment variable to the `web` service, the frontend build process now recognizes `NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX`, allowing inline formulas to render properly. ## Changes - Updated [`docker/docker-compose-template.yaml#L104`](https://github.com/Dave0126/dify/blob/10e33774a1ff67c54f9de96fe87f803da4c899a8/docker/docker-compose-template.yaml#L104): - Added the following line under the web service environment section: ```yaml NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX: ${NEXT_PUBLIC_ENABLE_SINGLE_DOLLAR_LATEX:-false} ``` <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ## Screenshots | Before | After | |--------|-------| | <img width="648" height="521" alt="508053885-bb56a9f4-4d86-49b8-b3f8-c47e4d7f23a8" src="https://github.com/user-attachments/assets/6ee0f9ae-75d6-4a24-bc17-2ef590cba889" /> | <img width="648" height="521" alt="508057944-08461f79-21da-43eb-94e8-04c6088ee9a3" src="https://github.com/user-attachments/assets/aa82d25f-de98-4613-a5a4-4969f5679270" /> | ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:50:14 -05:00
yindo closed this issue 2026-02-21 20:50:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31836