prodigy service not starting from Docker

I am trying to dockerize prodigy . The image was built successfully when I try to run the docker image it does not give any errors but at the same time it does not open up the service to annotate.

Here is my docker file

FROM python:3.7-slim-buster
WORKDIR /opt/app
COPY requirements.txt ./ 
COPY prodigy*.whl ./
COPY train_test2.jsonl ./
COPY  main.py ./
RUN pip install -r requirements.txt
RUN pip install -f ./prodigy*.whl
RUN python -m spacy download en_core_web_sm
COPY --chown=python:python app .
COPY prodigy.json ./

# ENV PRODIGY_ALLOWED_SESSIONS "user1,user2"
# CMD python -m prodigy textcat.manual train_test2 train_test2.jsonl --label "POSITIVE, NEUTRAL, NEGATIVE" --exclusive
RUN useradd python
ADD main.py ./
CMD ["python", "-u", "main.py","--port", "5000"]

my docker compose file

version: '3'

services:

    prodigy-test:

        container_name: prodigy-test

        image: prodigy-test

        hostname: prodigy-test

        command:  python main.py run -h 0.0.0.0

        build:

            context: .

        environment:

            LOGGING_LEVEL: 'INFO'

            LOGGING_WERKZEUG_ENABLED: 'True'

            SERVER_PORT: '5000'

        ports:

            - '5000:5000'

This is my main .py

import prodigy

model = 'textcat.manual'
dataset_name = 'train_test2'
json_file = 'train_test2.jsonl'
labels = ['POSITIVE', 'NEUTRAL', 'NEGATIVE']
host = '0.0.0.0'
port = 5000
prodigy.serve(model, dataset_name, json_file, '', labels,True, None, port=port)

This is my prodigy.json

{
  "host" : "0.0.0.0"
}

Any ideas on what could be missing to start the service?

Can you share the logs from when you attempt to start the container?

Not sure if i am doing it right. This is what I got when I setup logs

docker logs 51fad468a6dd
*Added dataset train_test2 to database SQLite.*

*✨  Starting the web server at http://0.0.0.0:5000 ...*
*Open the app in your browser and start annotating!*

It looks like the server started correctly and is running. What happens when you try and access it on that port?

When i try to bring the service up it just hangs in there nothing shows up (like starting service on http://0.0.0.0:5000) .

docker-compose up prodigy-test
Docker Compose is now in the Docker CLI, try `docker compose up`

Creating network "ml_workflow_default" with the default driver
Creating prodigy-test ... done
Attaching to prodigy-test

When I hit my local host on port 5000 I see this image

In your browser try replacing http://0.0.0.0:5000 with http://127.0.0.1:5000.

Inside of the container it's important to bind to "0.0.0.0" otherwise prodigy isn't accessible outside of the container, so that looks good. The "0.0.0.0" maps to "all interfaces". On Linux and OSX the system also routes any "0.0.0.0" routes to localhost automatically, but on Windows that doesn't happen so you need to change the IP address when loading the site.

I hope that helps!

Thanks Rob ! Replacing http://0.0.0.0:5000 with http://127.0.0.1:5000 worked