Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to set custom environment variable on client building with docker#1033

Unanswered
marcosgcd asked this question inQ&A
Discussion options

Trying to add a custom environment variable in the Frontend that renders the build dateREACT_APP_DATE (example).

I am usingDOCKER_BUILDKIT=1 docker build -f deploy/docker/Dockerfile -t lowcoderorg/lowcoder-ce . to build.

I tried everything I could think of.

  • created .env file in client/packages/lowcoder/.env
  • added"build": "REACT_APP_DATE=2023-07-10 vite build && cp ../../VERSION ./build/VERSION" to client/packages/lowcoder/package.json
  • Also Add REACT_APP_DATE to docker-compose.yaml and docker-compose-multi.yaml
  • orARG REACT_APP_DATE="2023-07-10" before build in Dockerfile

After build I still get undefined when trying to read itprocess.env.REACT_APP_DATE.
What am I doing wrong?

You must be logged in to vote

Replies: 1 comment

Comment options

The disappointing answer is, that this is in general not possible this way.
Reason is, that Lowcoder Frontend is an app, that get's packed (build) before we dockerize it.
As such, only if you would change the source code and then build your own docker, you could make use of an ENV - but also only static. Unfortunately ENVs are not the way to inject dynamic values in the Frontend.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@marcosgcd@FalkWolsky

[8]ページ先頭

©2009-2025 Movatter.jp