diff --git a/frameworks/rails/Dockerfile b/frameworks/rails/Dockerfile index 1a8c862be..261d56d5d 100644 --- a/frameworks/rails/Dockerfile +++ b/frameworks/rails/Dockerfile @@ -20,7 +20,7 @@ RUN bundle install --jobs=$(nproc) COPY . . -EXPOSE 8080 +EXPOSE 8080 8081 ENV THRUSTER_TARGET_PORT=8080 ENV THRUSTER_LOG_REQUESTS=false diff --git a/frameworks/rails/config/puma.rb b/frameworks/rails/config/puma.rb index 65ad56d1c..296826d44 100644 --- a/frameworks/rails/config/puma.rb +++ b/frameworks/rails/config/puma.rb @@ -1,7 +1,10 @@ thread_count = ENV.fetch('RAILS_MAX_THREADS', 4).to_i threads thread_count, thread_count -port 8080 +tls_cert_path = ENV.fetch('TLS_CERT', '/certs/server.crt') +tls_key_path = ENV.fetch('TLS_KEY', '/certs/server.key') +bind "tcp://0.0.0.0:8080" +bind "ssl://0.0.0.0:8081?cert=#{tls_cert_path}&key=#{tls_key_path}" # Allow all HTTP methods so Rack middleware can return 405 instead of Puma returning 501 supported_http_methods :any diff --git a/frameworks/rails/meta.json b/frameworks/rails/meta.json index 12c723db3..2befed455 100644 --- a/frameworks/rails/meta.json +++ b/frameworks/rails/meta.json @@ -12,6 +12,7 @@ "limited-conn", "json", "json-comp", + "json-tls", "upload", "api-4", "api-16", @@ -19,4 +20,4 @@ "static" ], "maintainers": [] -} \ No newline at end of file +}