nickvsnetworking / pyhss

Python HSS / Diameter Server
GNU Affero General Public License v3.0
71 stars 59 forks source link

Docker/Docker Compose: can't open file 'hss.py' #193

Open mazz opened 7 months ago

mazz commented 7 months ago

In order to get to the error can't open file 'hss.py', I needed to solve a catch-22 situation where I needed a static ip address before the docker build so I made a custom docker network for pyhss so I can preset the docker internal ip address for pyhss:

docker network create --subnet 172.31.0.1/16 --internal hss

and when I run docker network inspect $(docker network ls | awk '$3 == "bridge" { print $1}') | jq -r '.[] | .Name + " " + .IPAM.Config[0].Subnet' - I can see the new network:

...
hss 172.31.0.1/16
...

my docker-compose.yaml:

version: '3'
networks:
  hss:
    ipam:
      config:
        - subnet: "17.31.0.0/16"
services:
  pyhss:
    build: .
    image: pyhss
    container_name: pyhss
    env_file:
      - .env
    environment:
      - COMPONENT_NAME=hss-1
    volumes:
      - ./pyhss:/mnt/hss
    expose:
      - "3868/tcp"
      - "3868/sctp"
    ports:
      - "3868:3868/tcp"
      - "3868:3868/sctp"
    networks:
      hss:
        ipv4_address: "17.31.0.2"

After doing this, I managed to get the Dockerfile building, however I see another error:

pyhss  | /usr/bin/python3: can't open file 'hss.py': [Errno 2] No such file or directory
pyhss exited with code 2

This appears to be a bug. Where is hss.py?