Skip to content

Commit

Permalink
Use Puma command to start the Rails server (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianPasquale authored Dec 30, 2024
1 parent be73ad5 commit 8eca5b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ ENTRYPOINT ["./bin/docker-entrypoint"]

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD ["./bin/rails", "server"]

CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
2 changes: 1 addition & 1 deletion bin/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -e

# If running the rails server then create or migrate existing database
if ([ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]) || [ "${1}" == "./bin/dev" ]; then
if ([ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]) || [ "${1}" == "./bin/dev" ] || [[ $@ == *"bundle exec puma"* ]]; then; then
./bin/rails db:prepare
fi

Expand Down

0 comments on commit 8eca5b2

Please sign in to comment.