title: How to deploy to Heroku with Nodejs frontend, backend, and Docker
body: <p>There are similar posts, but my case is pretty specific on NodeJS-frontend-backend-Docker-Heroku, so I have stuck for a whole week now.</p>
  <p>Task : I have 2 folders frontend and backend. I have Dockerfile in both of them like this /frontend/Dockerfile and /backend/Dockerfille. I also have docker-compose.yml and Procfile on the root directory.</p>
  <p>Attempt 1 : change to Dockerfile.frontend and Dockerfile.backend. I use <code>heroku:container push --recursive</code>. Successfuly deploy it on Heroku, I already have <code>scale=1</code> too. It doesn't work.</p>
  <p>Attempt 2 : change Dockerfile.frontend to Dockerfile.web and Dockerfile.backend. The frontend web is working, but I can't login so I can't say for sure. I can't call api request to backend with <code>POST https://mycoolapp.herokuapp.com/api/users/login</code>. I also used Postman and nothing happened.</p>
  <p>My guess : the backend either doesn't work at all, or else I use <code>process.env.PORT || localhost:5000</code> incorrectly.</p>
  <p>I really need help with this. Sorry for my english. Thank you.</p>