Skip to content

Commit

Permalink
fix setting hostname and port (#257)
Browse files Browse the repository at this point in the history
* fix setting hostname and port

when using env vars in CMD, one must use `sh -c` to allow variable
evaluation

* we must exclude the shellcheck SC2086

reason: if we set the quoptes, the quotes will be also used by the
container.
the port must not have quotes.
  • Loading branch information
tuxmea committed Jan 10, 2024
1 parent d6e031b commit 33e29bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ COPY config/hdm.yml.template $APP_HOME/config/hdm.yml

RUN bundle check || (bundle config set --local without 'development test' && bundle install)

CMD ["/hdm/bin/entry.sh", "${HDM_PORT}", "${HDM_HOST}"]
CMD ["sh", "-c", "/hdm/bin/entry.sh ${HDM_PORT} ${HDM_HOST}"]
4 changes: 2 additions & 2 deletions bin/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ if [[ "${DEVELOP}" -eq 1 ]]; then
bundle exec rails db:seed
./bin/fake_puppet_db &
fi

bundle exec rails server -b "${HDM_HOST}" -p "${HDM_PORT}"
# shellcheck disable=SC2086
bundle exec rails server -b $HDM_HOST -p $HDM_PORT

0 comments on commit 33e29bc

Please sign in to comment.