title: How to have multiple projects running at the same time on docker
body: <p>I am new to docker and having trouble working with multiple projects since they all run on the same port.</p>
  
  <p>My docker-compose.yml:</p>
  
  <p><a href="https://i.stack.imgur.com/MWdKM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MWdKM.png" alt="enter image description here"></a></p>
  
  <p>My ../backend-web/Dockerfile:</p>
  
  <pre><code>FROM nginx
  
  COPY nginx.conf /etc/nginx/conf.d/default.conf
  </code></pre>
  
  <p>My nginx.conf:
  <a href="https://i.stack.imgur.com/JEpti.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JEpti.png" alt="enter image description here"></a></p>
  
  <p>And my .env file from where the ports are loaded:</p>
  
  <pre><code>DB_HOST=database-service
  DB_ROOT_PASSWORD=
  DB_DATABASE=
  DB_USERNAME=
  DB_PASSWORD=
  
  BACKEND_PORT=443
  DB_PORT=3306
  REDIS_PORT=6379
  PHP_FPM_INSTALL_XDEBUG=true
  </code></pre>
  
  <p>Now this all works when I do docker-compose up, I can access <a href="https://localhost" rel="nofollow noreferrer">https://localhost</a>, but I want to have more than 1 projects, when i try to use same docker compose file for other projects it does not work because it uses the same port. I tried changing the 443 to 444 and mysql port to 3307 but then it does not load <a href="https://localhost:444" rel="nofollow noreferrer">https://localhost:444</a>.</p>
  
  <p>How can I solve this issue?</p>