Can't access site on localhost:4000

Hi all, new to the forum and to Jekyll.

I am running Jekyll in a Docker container on Ubuntu 22.04 LTS.

Here are my logs:

fatal: not a git repository (or any parent up to mount point /srv)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /srv)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
csv was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add csv to your Gemfile or gemspec to silence this warning.
/usr/local/lib/ruby/3.3.0/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
/usr/local/bundle/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb:22: warning: base64 was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add base64 to your Gemfile or gemspec to silence this warning.
/usr/local/bundle/gems/liquid-4.0.4/lib/liquid.rb:72: warning: bigdecimal was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0.
You can add bigdecimal to your Gemfile or gemspec to silence this warning.
Configuration file: /srv/jekyll/_config.yml
  Jekyll Spaceship: πŸš€ Jekyll-Spaceship 0.10.2
  Jekyll Spaceship: πŸŽ‰ A Jekyll plugin to provide powerful supports.
  Jekyll Spaceship: πŸ‘‰ https://github.com/jeffreytse/jekyll-spaceship
  Jekyll Spaceship: πŸ—‚  use table-processor
  Jekyll Spaceship: πŸ—‚  use mathjax-processor
  Jekyll Spaceship: πŸ—‚  use plantuml-processor
  Jekyll Spaceship: πŸ—‚  use mermaid-processor
  Jekyll Spaceship: πŸ—‚  use polyfill-processor
  Jekyll Spaceship: πŸ—‚  use media-processor
  Jekyll Spaceship: πŸ—‚  use emoji-processor
  Jekyll Spaceship: πŸ—‚  use element-processor
            Source: /srv/jekyll
       Destination: /srv/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
  Jekyll Spaceship: [MathjaxProcessor] _posts/2015-01-01-welcome-to-jekyll.md
  Jekyll Spaceship: [TableProcessor] _posts/2015-02-28-test-markdown.md
  Jekyll Spaceship: [EmojiProcessor] _posts/2015-02-28-test-markdown.md
  Jekyll Spaceship: [PolyfillProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [PlantumlProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [MermaidProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [TableProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [MathjaxProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [MediaProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [EmojiProcessor] _posts/2016-01-01-another-test-markdown.md
  Jekyll Spaceship: [TableProcessor] _posts/2017-05-20-this-post-demonstrates-post-content-styles.md
  Jekyll Spaceship: [TableProcessor] _posts/2017-06-10-quick-mardown-example.md
  Jekyll Spaceship: [MathjaxProcessor] _posts/2017-06-10-quick-mardown-example.md
  Jekyll Spaceship: [PlantumlProcessor] _posts/2017-12-04-plantuml-example.md
  Jekyll Spaceship: [MermaidProcessor] _posts/2017-12-08-mermaid-example.md
  Jekyll Spaceship: [TableProcessor] _posts/2017-12-15-table-example.md
  Jekyll Spaceship: [MathjaxProcessor] _posts/2017-12-15-table-example.md
  Jekyll Spaceship: [MediaProcessor] _posts/2017-12-18-video-example.md
  Jekyll Spaceship: [EmojiProcessor] about.html
  Jekyll Spaceship: [MathjaxProcessor] index.html
                    done in 1.32 seconds.
 Auto-regeneration: enabled for '/srv/jekyll'
    Server address: http://0.0.0.0:4000/
  Server running... press ctrl-c to stop.

Accessing localhost:4000 in Firefox tells me that my browser cannot establish a connection.

Typing in sudo lsof -i :4000 doesn’t bring up anything else on that port.

I can find the IP address of my container, and putting in :4000 gives me an error that my request has timed out.

I can grab the contents of an HTML file and display them in the terminal, so something can see them, it’s just not serving them.

Could you show the Docker command? In particular the -p or --publish flag, which would control how container ports are exposed.