1

I'm running docker-compose to run my application which listen to REST api calls.
For some reason it is not accessible from outside.
I don't understand what am I doing wrong.

Here is the configuration:

version: '3.4'

services:
  rabbitmq:
    image: rabbitmq:3-management
    ports:
      - 5672:5672
      - 15672:15672
  my-server:
    image: my-server
    build:
      context: .
      dockerfile: ./apiserver/Dockerfile
    ports:
      - 5000:5000
    restart: on-failure
    depends_on:
      - rabbitmq

and my Dockerfile is:

FROM ubuntu:16.04

RUN apt-get update -y && \
    apt-get install -y python-pip python-dev

# We copy just the requirements.txt first to leverage Docker cache
COPY ./requirements.txt /app/requirements.txt

WORKDIR /app

RUN pip install -r requirements.txt

COPY . /app
EXPOSE 5000
ENTRYPOINT [ "python" ]

CMD [ "app.py" ]
β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
toto
  • 1,197
  • 2
  • 15
  • 26
  • *For some reason it is not accessible from outside* > please explain further: how do you try to *access it from outside* – β.εηοιτ.βε Jan 16 '21 at 17:30
  • listen on 0.0.0.0 and make sure you have exposed the relevant port in the service definition in the compose file. – Paul Collingwood Jan 16 '21 at 17:48
  • 2
    Does [Deploying a minimal flask app in docker - server connection issues](https://stackoverflow.com/questions/30323224/deploying-a-minimal-flask-app-in-docker-server-connection-issues) address your problem? If not, can you edit this question to include the top-level application code, similar to what's in that question? – David Maze Jan 16 '21 at 17:49

0 Answers0