docker: substitute $EGO_NODE_ADDRESS at runtime instead of build time

parent cd5f6b50
......@@ -39,6 +39,7 @@ services:
build:
context: nginx
dockerfile: Dockerfile
command: bash -c "envsubst '$$EGO_NODE_ADDRESS' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
environment:
EGO_NODE_ADDRESS: extensions-web
restart: always
......
......@@ -2,13 +2,14 @@ FROM nginx:stable
MAINTAINER Yuri Konotopov <ykonotopov@gnome.org>
COPY nginx.conf /tmp
COPY nginx.conf /etc/nginx/nginx.conf.template
RUN set -ex \
&& envsubst '$EGO_NODE_ADDRESS' < /tmp/nginx.conf > /etc/nginx/nginx.conf \
&& rm /tmp/nginx.conf \
&& mkdir -p /extensions-web/www \
&& chmod g+rwX -R /extensions-web/www \
&& chmod g+rwX -R /var/log/nginx \
&& chmod g+rwX -R /var/cache/nginx \
&& chmod g+rwX -R /var/run
&& chmod g+rwX -R /var/run \
&& touch /etc/nginx/nginx.conf \
&& chmod g+rw /etc/nginx/nginx.conf \
&& chmod g+rw /etc/nginx/nginx.conf.template
......@@ -267,13 +267,7 @@
"from": {
"kind": "ImageStreamTag",
"name": "nginx:stable"
},
"env": [
{
"name": "EGO_NODE_ADDRESS",
"value": "${EGO_NODE_ADDRESS}"
}
]
}
}
},
"output": {
......@@ -497,6 +491,19 @@
{
"name": "frontend",
"image": "${DEFAULT_DOCKER_REGISTRY}/${NAME}/frontend:latest",
"command": [
"bash"
],
"args": [
"-c",
"envsubst '$EGO_NODE_ADDRESS' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"
],
"env": [
{
"name": "EGO_NODE_ADDRESS",
"value": "${EGO_NODE_ADDRESS}"
}
],
"ports": [
{
"containerPort": 8080
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment