Spaces:
Sleeping
Sleeping
Change default port to 7860 for Hugging Face Spaces compatibility
Browse files- Dockerfile +1 -1
- bin/start.sh +1 -1
- 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
|
| 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:-
|
| 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
|
| 32 |
-
port ENV.fetch("PORT",
|
| 33 |
|
| 34 |
# Bind explicitly to all interfaces in container environments.
|
| 35 |
-
bind "tcp://0.0.0.0:#{ENV.fetch('PORT',
|
| 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
|