hatamo commited on
Commit
683b833
·
1 Parent(s): 1a3f3cf

Change default port to 7860 for Hugging Face Spaces compatibility

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. bin/start.sh +1 -1
  3. config/puma.rb +3 -3
Dockerfile CHANGED
@@ -76,5 +76,5 @@ COPY --chown=rails:rails --from=build /rails /rails
76
  ENTRYPOINT ["/rails/bin/docker-entrypoint"]
77
 
78
  # Start server - all startup logic handled by bin/start.sh
79
- EXPOSE 8080
80
  CMD ["./bin/start.sh"]
 
76
  ENTRYPOINT ["/rails/bin/docker-entrypoint"]
77
 
78
  # Start server - all startup logic handled by bin/start.sh
79
+ EXPOSE 7860
80
  CMD ["./bin/start.sh"]
bin/start.sh CHANGED
@@ -51,7 +51,7 @@ if [ "$SKIP_CREDENTIALS" = false ]; then
51
  bundle exec rails assets:precompile || true
52
  fi
53
 
54
- echo "[container] Starting Rails server on 0.0.0.0:${PORT:-8080}"
55
  echo "[container] Ready to accept requests!"
56
 
57
  # Use exec to replace the shell process with Rails server
 
51
  bundle exec rails assets:precompile || true
52
  fi
53
 
54
+ echo "[container] Starting Rails server on 0.0.0.0:${PORT:-7860}"
55
  echo "[container] Ready to accept requests!"
56
 
57
  # Use exec to replace the shell process with Rails server
config/puma.rb CHANGED
@@ -28,11 +28,11 @@
28
  threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
29
  threads threads_count, threads_count
30
 
31
- # Specifies the `port` that Puma will listen on to receive requests; default is 8080 to match container environments.
32
- port ENV.fetch("PORT", 8080)
33
 
34
  # Bind explicitly to all interfaces in container environments.
35
- bind "tcp://0.0.0.0:#{ENV.fetch('PORT', 8080)}"
36
 
37
  # Allow puma to be restarted by `bin/rails restart` command.
38
  plugin :tmp_restart
 
28
  threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
29
  threads threads_count, threads_count
30
 
31
+ # Specifies the `port` that Puma will listen on to receive requests; default is 7860 for Hugging Face Spaces.
32
+ port ENV.fetch("PORT", 7860)
33
 
34
  # Bind explicitly to all interfaces in container environments.
35
+ bind "tcp://0.0.0.0:#{ENV.fetch('PORT', 7860)}"
36
 
37
  # Allow puma to be restarted by `bin/rails restart` command.
38
  plugin :tmp_restart