twitter-backend-node icon indicating copy to clipboard operation
twitter-backend-node copied to clipboard

INFRA: Add Dockerization support

Open ohbus opened this issue 4 years ago • 8 comments

  • [ ] Allow building a Dockerfile of this project.
  • [ ] Add a docker-compose.yml file that can deploy this with a Postgres instance.

ohbus avatar Jun 24 '21 07:06 ohbus

Hi @ohbus @championswimmer can I pick this up? Thanks

subhatanay avatar Jul 13 '21 18:07 subhatanay

@subhatanay go ahead :)

Right now it is very early stage of the project, very few contributors, so you can just write "I am picking this up" instead of waiting for permission

championswimmer avatar Jul 14 '21 15:07 championswimmer

@subhatanay, hey, let me know if you need any help with this issue. :) I was working on it for a while.

alpha037 avatar Jul 14 '21 20:07 alpha037

Hi @alpha037 .. Currently working on this. Dockerfile is done .. planing to move the Configs to .env file instead of app.module.ts file. Which can be used both via application as well the docker-compose file

Will try to raise a pull request by today night

thanks

subhatanay avatar Jul 15 '21 08:07 subhatanay

@subhatanay, sounds great! @nestjs/config should do the trick.

alpha037 avatar Jul 15 '21 13:07 alpha037

PR Created for this Task https://github.com/scaleracademy/twitter-backend-node/pull/10

Please check this Thanks

subhatanay avatar Jul 15 '21 20:07 subhatanay

@championswimmer @ohbus @subhatanay, hey guys, don't we need to wait for the database instance to get ready to accept connections?

Even after the db instance starts up, I guess it takes some time to accept other connections maybe?

Reference: https://docs.docker.com/compose/startup-order/

alpha037 avatar Jul 16 '21 08:07 alpha037

Hi @alpha037 .. I had gone through this docker docs. Without this also it works fine postgres starts and then app docker starts. Also application also have a retry logic which can retry until a application properly start. Felt like not needed now. If all saying needed i can implement then.

subhatanay avatar Jul 16 '21 15:07 subhatanay