Skip to content

Commit aec1db1

Browse files
committed
fix: adjust puma to bind ports
1 parent 379cf90 commit aec1db1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

config/puma.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# Puma configuration file for ProStaff API
44

55
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
6+
# Bind to 0.0.0.0 to allow external connections (required for Docker/Railway)
67
port ENV.fetch('PORT', 3000)
8+
bind "tcp://0.0.0.0:#{ENV.fetch('PORT', 3000)}"
79

810
# Specifies the `environment` that Puma will run in.
911
# If PORT is set (common in production environments), default to production

railway.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ builder = "dockerfile"
44
dockerfilePath = "Dockerfile.production"
55

66
[deploy]
7-
# Alteração 1: Forçar o binding em 0.0.0.0 e usar a porta injetada pelo Railway
8-
startCommand = "bundle exec puma -b 0.0.0.0 -p ${PORT:-8080} -C config/puma.rb"
7+
# Use puma.rb configuration for binding (it already handles PORT env var)
8+
startCommand = "bundle exec puma -C config/puma.rb"
99

10-
# Alteração 2: Mudar o caminho para o padrão do Rails 7.1+
10+
# Health check configuration
1111
healthcheckPath = "/up"
1212
healthcheckTimeout = 300
1313
restartPolicyType = "on_failure"

0 commit comments

Comments
 (0)