New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[appserver-io/appserver] Pass environment variable to virtual-hosts.xml #1018

Closed
DavidFeller opened this Issue May 24, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@DavidFeller
Member

DavidFeller commented May 24, 2016

We are running appserver.io inside of several identical docker containers to serve legacy applications like Magento. These containers are orchestrated by docker-compose. Currently we have to mount a host directory that contains a virtual-hosts.xml as a volume to /opt/appserver/etc/appserver/conf.d to be able to give each container an individual virtual host name.

It would be great, if it was possible to just pass the virtual host name as an environment variable that can be defined in docker-compose.yml to the containers virtual-hosts.xml.

appserver-vhost-config

@wick-ed wick-ed changed the title from Pass environment variable to virtual-hosts.xml to [appserver-io/appserver] Pass environment variable to virtual-hosts.xml May 24, 2016

@wagnert

This comment has been minimized.

Show comment
Hide comment
@wagnert

wagnert Sep 13, 2016

Member

Hi @DavidFeller,

i actually think about the best way of passing the Docker environment variables to the appserver.io configuration files. It would be possible to make all environment variables available in the appserver.io configuration files, as you can already use pre-defined variable names since version 1.1.1.

Another, probably more pragmatic, solution would be a simple replacement using sed like

RUN sed -i "s/${VIRTUALHOST_NAME}/appserver.local/g" etc/appserver/conf.d/virtual-hosts.xml

You can have a look at the appserver.io Dockerfile where we replaced the default values with Docker specific ones.

What do you think?

Member

wagnert commented Sep 13, 2016

Hi @DavidFeller,

i actually think about the best way of passing the Docker environment variables to the appserver.io configuration files. It would be possible to make all environment variables available in the appserver.io configuration files, as you can already use pre-defined variable names since version 1.1.1.

Another, probably more pragmatic, solution would be a simple replacement using sed like

RUN sed -i "s/${VIRTUALHOST_NAME}/appserver.local/g" etc/appserver/conf.d/virtual-hosts.xml

You can have a look at the appserver.io Dockerfile where we replaced the default values with Docker specific ones.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment