I
I
igorlebedev2017-04-10 13:20:20
Web development
igorlebedev, 2017-04-10 13:20:20

Docker & web app?

I have a web application that is built by Webpack to run under Nginx.
There is a Docker container with this web application.
Question: is it possible to specify the API URL through environment variables?
If you use node.js, then there are no questions, but what about when using nginx.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2017-04-10
@sergiks

edit nginx configs by script?

sed -i "s/%%%%%%/$API_URL/ig"  "/etc/nginx/nginx.conf"

O
OnYourLips, 2017-04-10
@OnYourLips

You can, in the entrypoint script, get from ENV and change the necessary files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question