-
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?
Changes from all commits
aebc3b1
98db224
41fa4c8
ae13692
8d2923b
f4658e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Publish Docker image | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Log in to GitHub Container Registry | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v2 | ||
|
|
||
| - name: Build Docker image | ||
| run: | | ||
| repo_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | ||
| docker build -t ghcr.io/${repo_name}/dvb-i-reference-client:latest . | ||
|
|
||
| - name: Push Docker image to GitHub Container Registry | ||
| run: | | ||
| repo_name=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | ||
| docker push ghcr.io/${repo_name}/dvb-i-reference-client:latest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| FROM php:8.1-apache | ||
|
|
||
| COPY ./ /var/www/html/client | ||
|
|
||
| RUN a2enmod rewrite | ||
| RUN a2enmod expires |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| version: '1.0' | ||
| services: | ||
| dvb-i-reference-client: | ||
| # Comment build and uncomment image if you want to use prebuilt image rather than build from the source code | ||
| # build: . | ||
| image: ghcr.io/ccma-enginyeria/dvb-i-reference-client/dvb-i-reference-client:latest | ||
| # Uncomment volumes if you want to use the source code rather than use from docker image | ||
| # volumes: | ||
| # - ./:/var/www/html/client | ||
| environment: | ||
| - INSTALL_LOCATION=${INSTALL_LOCATION:-http://localhost:8888/client} | ||
| ports: | ||
| - "8888:80" |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to see a solution where this file (and probably |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| // DVB-I Reference installation location -- also backend/configuration.php | ||
| var INSTALL_LOCATION = "https://dvb-i-reference.dvb.org/client"; | ||
| var INSTALL_LOCATION = "/client"; | ||
|
|
||
| // set to true to include <Service> channels that are not included in the selected LCN table. | ||
| var INCLUDE_NON_LCN_CHANNELS = false; |
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?
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.jswhich 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