HTTP gateway in containerized setup

Hey everyone,

So I have started messing around with Docker and I feel that I’ve got most of that under the belt. I have setup my own private network (of which an nginx container is on as well which I aim to use to proxy_pass to the HTTP gateway) and I have IPFS attached to that network, all of that is fine and I can definately access port 5001 via this.

However, what I noticed is that the image itself (shown in the compose.yml file below) doesn’t seem to start or configure IPFS for HTTP gateway access. I’d like to know what I would need to do in order to get this right.

A simple mount point in docker-compose? Or a derived Dockerfile/image entirely?

My compose.yml:

version: '3.8'

networks:
  ipfs:
    name: "sunnet"
    external: true


services:
  ipfs:
    image: ipfs/kubo:master-latest
    restart: unless-stopped
    container_name: ipfs
    volumes:
      - /home/deavmi/vols/ipfs/store:/data/ipfs
      - /tmp/ipfsFuse:/ipfs
      - /tmp/ipnsFuse:/ipns
    environment:
      - IPFS_PATH=/data/ipfs
    networks:
      ipfs:
        ipv4_address: 10.0.1.54
    ports:
      # Swarm listens on all interfaces, so is remotely reachable.
      - 4001:4001/tcp
      - 4001:4001/udp
1 Like

Does it work as expected with port 8080 exposed? That’s what Kubo listens on by default for HTTP gateway access.

If I add an entry for docker-proxy-ing by adding the:

- ports:
    - 0.0.0.0:8080:8080

Still no luck. For reference this is the startup log

Initializing daemon...

Kubo version: 0.23.0-dev-c5868a8

Repo version: 14

System version: arm64/linux

Golang version: go1.19.10

2023/07/27 19:35:58 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.

Swarm listening on /ip4/10.0.1.54/tcp/4001

Swarm listening on /ip4/10.0.1.54/tcp/8081/ws

Swarm listening on /ip4/127.0.0.1/tcp/4001

Swarm listening on /ip4/127.0.0.1/tcp/8081/ws

Swarm listening on /p2p-circuit

Swarm announcing /ip4/10.0.1.54/tcp/4001

Swarm announcing /ip4/10.0.1.54/tcp/8081/ws

Swarm announcing /ip4/127.0.0.1/tcp/4001

Swarm announcing /ip4/127.0.0.1/tcp/8081/ws

RPC API server listening on /ip4/0.0.0.0/tcp/5001

WebUI: http://0.0.0.0:5001/webui

RPC API server listening on /ip6/::/tcp/5001

WebUI: http://[::]:5001/webui

Daemon is ready
1 Like

Ah sorry, I don’t have much experience with Docker (drives me nuts usually). I hope someone who does can chime in here :pray:.

1 Like

Thanks! Any help would be appreciated very much!