Hello, I’m running a tcp server in docker. I can access it with the host machine’s public ipv4, but because that’s dynamic it’s changing all the time I assigned a static IP to docker to reach it at 172.21.128.2:4243. Unfortunately I can’t access the defined ipv4 off the host machine.
docker-compose:
networks:
static-network:
ipam:
config:
- subnet: 172.21.0.0/16
services:
reticulumtcp:
build:
dockerfile_inline: |
FROM node:lts-alpine
ENV PYTHONUNBUFFERED=1
#install pip then rns if pip successfully installed
RUN apk add --update --no-cache python3 py3-pip && pip install --break-system-packages rns
ENTRYPOINT ["rnsd", "--verbose"]
networks:
static-network:
ipv4_address: 172.21.128.2
ports:
- 4243:4243 #tcp server for reticulum
init: true
tty: true #to keep it running
container_name: "reticulumtcp"
configs:
- source: config2
target: /root/.reticulum/config
restart: unless-stopped
configs:
config2:
content: |
[reticulum]
enable_transport = True
share_instance = Yes
loglevel = 4
[interfaces]
[[Default Interface]]
type = AutoInterface
enabled = Yes
[[tcp server]]
type = TCPServerInterface
mode = gateway
enabled = yes
listen_ip = 0.0.0.0
listen_port = 4243
on both host machine and from the docker when I run wget -qO - ifconfig.me I get the host’s IP in the 149.XX.XXX.XX range. I expected 172.21.128.2 as the result. Any idea where I went wrong?