The main problem in front-end projects that they are working in the browser, so it will be too hard and not logical to access Docker env variables on the server from the FE project in the browser. Usually, these projects Docker containers compose of Nginx container that is serving the project to be loaded to the browser. The trick to turning around this problem is to find a way to load these variables inside the final build of the FE project, so the project can use them in run-time in the browser.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Ahmad
Contact Ahmad, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack