0

I am trying to dockerize two applications, one being streamlit, the other being fastapi, I have built the individual docker images for them, and now trying to run them at the same time so they communicate using docker-compose. I have written the code but get an error when i run docker-compose up --build, that says ERROR: Service "backend" uses an undefined network "AIservice" because of this part of the code networks: AIservice: aliases: - backend.docker

how do i fix this error

mark
  • 41
  • 5
  • Have you defined the network "Alservice" ?, before you can use the network needs to be defined, issue `docker network ls` command and provide the output. – JayantSeth May 17 '22 at 14:37
  • For 99% of cases, it works to just delete all of the `networks:` blocks in the `docker-compose.yml` file. Compose provides a network named `default` that will be used automatically. Also see [Networking in Compose](https://docs.docker.com/compose/networking/) in the Docker documentation. – David Maze May 17 '22 at 14:42
  • 1
    Can you please provide the docker-compose file – Haythem ROUIS May 17 '22 at 15:01

0 Answers0