Skip to content
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

Fix Docker issue #2993

Merged
merged 13 commits into from
Oct 26, 2022
Merged

Fix Docker issue #2993

merged 13 commits into from
Oct 26, 2022

Conversation

alejandro-kid
Copy link
Collaborator

I did three changes:

  • Change th way of build the container.
  • Change script to generate application.yml:

    Explanation: The awk command iterates through each element of a list and executes its instructions, in each iteration it checks that the corresponding environment variable contains information. Since it is impossible to declare a valid environment variable for the system with the following structure 'Cenit::Admin:default_uri', it is decided to create it from one that is valid and eliminate the other environment variable declared in the file, to be provided by the system globally.

  • It necesary when the container run, declare a variable called: ADMIN_UI.

COPY ./env.sh .
RUN chmod +x env.sh

CMD ["/bin/bash", "-c", "/var/www/cenit/env.sh; bundle exec unicorn_rails -c config/unicorn.rb"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this file like was before and add this line at the end

@alejandro-kid
Copy link
Collaborator Author

  • Delete application.docker.yml: Now the config/application.yml will be create inline using an script when the container run. For this purpose need declared two environment variables HOMEPAGE and CENIT_UI.

    Note: The main conclusion of all my test is that in application.yml need to have both env variables (HOMEPAGE and Cenit::Admin:default_uri), even if HOMEPAGE is not in it, the platform will not redirect correctly.

  • Update docker-compose.yml: Here I deleted the configuration of NGINX. Docker compose is not for productions, so dont have sense configure NGINX, i remove this element to do the file more simple.
  • Enable build container in developer branch and redefine tags of container: I think that the best way to resolve a bug is knowin where is it. For this reason I configured a system of tags, the tags of master branch will be latest and a short sha (the first 7 numbers), because with the current tag when a new container is pushed override the previusly. And in developer branch the container will have a tag as following: develop-${SHA}

@alejandro-kid alejandro-kid merged commit b760f96 into develop Oct 26, 2022
@alejandro-kid alejandro-kid deleted the docker-issue branch October 26, 2022 06:10
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.

2 participants