-
Notifications
You must be signed in to change notification settings - Fork 26
Docker running alternative #110
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to see a solution where this file (and probably backend/configuration.php also) can be used in different scenarios. This change means that the frontend and backend are running in the same container - ideally the backend should run in the container and provide the separate frontend client with INSTALL_LOCATION in frontend/configuration.js based on the container address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using environment variable to set the $install_location in the backend might be problematic outside the docker container. As far as I understand, the environment variables need to be configured on the web server level ( apache or nginx php configuration ). If the backend is used form a user directory they may not have the option to change the web server configuration and if there are multiple users in the same domain then they would need different environment variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps something like this would be a good way for both use cases? use the environment variable and there is a fallback value if the environment variable is not set?
<?php
//
// install_location is the installation directory
// see also frontend/configuration.js
//
//Docker uses install location from environment variable
if(isset($_ENV['INSTALL_LOCATION'])) {
$install_location = $_ENV['INSTALL_LOCATION']
}
else {
//configure install location here if used without docker
$install_location = "https://dvb-i-reference.dvb.org/client";
}
?>
Perhaps the environment variable name should be more specific to avoid possible collisions? Maybe "DVB_I_INSTALL_LOCATION"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to deal with frontend/confiiguration.js which currently has the absolute URL to the installed backend. If the backend and frontend are both running in the same machine, then 'localhost' can be used - but this is seldom the situation
Hello team!
We are deploying and developing it using Docker, which has been very useful for us. If you find it helpful as well, feel free to approve the PR that includes the Dockerfile and docker-compose.yml.
Kind regards!