Skip to content

Commit

Permalink
Merge pull request #101 from gcj-group/main
Browse files Browse the repository at this point in the history
[FIX] Tweaking Docker setup to enable running shell commands when deployed
  • Loading branch information
mllemango authored Aug 18, 2023
2 parents 4314b9f + d151abd commit febb3e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh

ENTRYPOINT ["entrypoint.sh"]

CMD rails server -b 0.0.0.0 -e production
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
set -e

# Remove a potentially pre-existing server.pid for Rails.
rm -f /app/tmp/pids/server.pid
if [ -f /app/tmp/pids/server.pid ]; then
rm -f /app/tmp/pids/server.pid
fi

bin/rails db:create
bin/rails db:migrate

rails server -b 0.0.0.0 -e production
exec "$@"

0 comments on commit febb3e4

Please sign in to comment.