Skip to content

Conversation

@CCMA-Enginyeria
Copy link

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!

Copy link
Collaborator

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

Copy link
Collaborator

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.

Copy link
Collaborator

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"?

Copy link
Collaborator

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants