title: Angular container can't http request to my java container
body: <p>I'm new to docker, but I'm trying to implement it in my job, here's the case, I have this angular application &quot;vehicle-management-view&quot; as frontend and this java application as backend &quot;vehicle-management-api&quot; from which my view do http requests. Both applications are already in containers and working fine individually, but the view can't request to the api no matter what I do, network, ports and all this stuff was configured but it just doesn't work, I may be forgeting something, here are my dockerfiles, docker compose and my request configurations...</p>
  <p><strong>API dockerfile:</strong></p>
  <pre><code>FROM openjdk:8-alpine
  WORKDIR /opt/docker/vehicle-management
  COPY /target/vehicleManagementApi.jar /opt/docker/vehicle-management
  ENTRYPOINT java -jar vehicleManagementApi-0.0.1-SNAPSHOT.jar
  </code></pre>
  <p><strong>VIEW dockerfile:</strong></p>
  <pre><code>FROM node:alpine as build-stage
  WORKDIR /build/vehicle-management-view/
  COPY package*.json /build/vehicle-management-view/
  RUN npm install
  COPY ./ ./
  RUN npm run build
  
  # DEPLOY STAGE
  FROM nginx:alpine
  COPY --from=build-stage build/vehicle-management-view/dist/vehicle-management-view/ /usr/share/nginx/html
  </code></pre>
  <p><strong>Docker Compose</strong>:</p>
  <pre><code>version: '3'
  networks:
    vehicle-management-network:
      driver: bridge
  services:
    vehicle-management-api-service:
      build: 
        context: ./vehicleManagementApi
        dockerfile: vehicle-management-api.dockerfile
      image: cap/vehicle-management-api
      container_name: vehicle-management-api
      hostname: vehicle-management-api
      expose:
       - 8081
      networks:
        - vehicle-management-network
    vehicle-management-view-service:
      build:
        context: ./vehicle-management-view
        dockerfile: vehicle-management-view.dockerfile
      image: cap/vehicle-management-view
      container_name: vehicle-management-view
      hostname: vehicle-management-view
      depends_on:
        - vehicle-management-api-service
      ports:
        - 4200:80
      networks:
        - vehicle-management-network
  </code></pre>
  <p>On my view I tried some guesses on the request uri, each one gave me an error:</p>
  <pre><code>http://localhost:8081/ -&gt; ERR_CONNECTION_REFUSED
  http://vehicle-management-api:8081/ -&gt; ERR_NAME_NOT_RESOLVED
  vehicle-management-api:8081/ -&gt; ERR_NAME_NOT_RESOLVED
  </code></pre>
  <p>I think the problem may be my lack of experience, any help is much appreciated!</p>