title: How to link frontend and backend docker containers
body: <p>I am currently developping a <code>Spring Boot</code> and a <strong>reactJs application</strong>, using Postgresql as a database. My Spring and my reactJs application are in a two seperate projects. I tried to dockerize my application using docker-compose. So in the server side I have both my postgresql and my <code>springboot</code> services defined in the docker-compose file.
  Which is</p>
  <pre><code>version: '3'
  services:
    app:
      image: app
      depends_on:
      - mypostgres
      ports:
       - &quot;9000:8086&quot;
      environment:
        - DATABASE_HOST=mypostgres
        - DATABASE_USER=root
        - DATABASE_PASSWORD=root
        - DATABASE_NAME=test
        - DATABASE_PORT=5432
  
  
  
    mypostgres:
      image: postgres:9.6-alpine
      container_name: mypostgres
  
      ports:
       - &quot;5433:5432&quot;
  
      environment:
       - POSTGRES_PASSWORD=root
       - POSTGRES_USER=root
       - POSTGRES_DB=irooldb
      volumes:
      - ./postgres-data:/var/lib/postgresql/data
  </code></pre>
  <p>For the <code>Client side</code>, I did not use docker-compose I only added a Dockerfile
  and run my client side application in a seperate container.</p>
  <p>My questions are:</p>
  <p>How to link my client Container to my server side container?</p>
  <p>Should I define a client service in the docker-compose file situated in the server side project? Or is it okay that they run sepratly ?</p>