Skip to content

Commit

Permalink
Merge pull request #229 from betadots/allow_container_port_selection
Browse files Browse the repository at this point in the history
Allow selection of hdm container port
  • Loading branch information
rwaffen authored Nov 30, 2023
2 parents 0d2cb7d + 831dd08 commit e0e73ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
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}"

0 comments on commit e0e73ea

Please sign in to comment.