title: Calling rest API through docker container
body: <p>I have developed backend Rest API using spring boot and frontEnd using angular 8 my question is I have deployed backend and frontend in the same server through docker-compose I need a way to make angular calling rest API through docker containers and network without exposing my backend rest API I have tried to call backend with its container name in angular but it is not working
  API link example from angular  http://shop_soofybackendservice/api/departments</p>
  <pre><code>version: '3'
  
  services:
    database:
      image: mysql:8.0.15
      environment:
        MYSQL_ROOT_PASSWORD: password
        MYSQL_DATABASE: dbname
      volumes:
        - databasevolume:/var/lib/mysql
      networks:
        - databasenetwork
      deploy:
        mode: replicated
        replicas: 1
        labels: [ database=MYSQL_DATABASE ]
  
  
    soofybackendservice:
      image: tomcatsoofybackend:latest
      #build:
      #  context: ./onlineshopping/soofy-trade
      #  dockerfile: Dockerfile
      environment:
        mysqlhost: shop_database
        mysqlupassword: 123456
        mysqluname: root
        imagesPath: /home/ubuntu/images
      volumes:
        - imagesvolume:/home/ubuntu/images
      ports:
        - 81:8080
      depends_on:
        - database
      networks:
        - databasenetwork
        - backendnetwork
      deploy:
        mode: replicated
        replicas: 1
        labels: [ backend=backendWep ]
  
  
    #tomcatsoofyfrontend
    #http://backend.medodolphin.com/
    soofyfrontendservice:
      image: mealfrontend:latest
      #build:
      #  context: ./onlineshopping/soofy-frontend
      #  dockerfile: Dockerfile
      ports:
        - 82:80
      depends_on:
        - database
      networks:
        - backendnetwork
      deploy:
        mode: replicated
        replicas: 1
        labels: [ frontend=frontendWeb ]
  
  
  volumes:
    databasevolume:
    imagesvolume:
  
  networks:
    databasenetwork:
    backendnetwork:
  </code></pre>