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

Allow selection of hdm container port #229

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ RUN apt update && apt install -y \

ENV APP_HOME /hdm
ENV RAILS_ENV production
ENV HDM_PORT 3000
ENV HDM_HOST 0.0.0.0

EXPOSE $HDM_PORT

WORKDIR $APP_HOME

Expand All @@ -27,6 +31,4 @@ COPY config/hdm.yml.template $APP_HOME/config/hdm.yml

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

EXPOSE 3000

CMD ["/hdm/bin/entry.sh"]
CMD ["/hdm/bin/entry.sh ${HDM_PORT} ${HDM_HOST}"]
5 changes: 4 additions & 1 deletion bin/entry.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

HDM_PORT=$1
HDM_HOST=$2

bundle exec rake db:setup
bundle exec rake hdm:assets

Expand All @@ -8,4 +11,4 @@ bundle exec rails db:seed
./bin/fake_puppet_db &
fi

bundle exec rails server -b 0.0.0.0
bundle exec rails server -b "${HDM_HOST}" -p "${HDM_PORT}"