Skip to content

Conversation

@marcelobalexandre
Copy link
Contributor

@marcelobalexandre marcelobalexandre commented Nov 23, 2021

I updated the docker-compose configuration to allow us to easily run the app with a docker-compose up.

I needed to add the HOST as 0.0.0.0 because the Swagger will be running in the same container as the API, and it will listen for requests to 0.0.0.0 instead of localhost inside the container.

I also needed to add a new SWAGGER_HOST as localhost because when accessing the /api-docs in the host machine, a request to 0.0.0.0 (the HOST env variable) will not go from the host machine to the Docker container, it needs to request to localhost.

I add container_name with the node-api-boilerplate prefix to avoid conflicts with other Docker containers that the developer can have.

I also added the mongo-express to make it easy to administrate the MongoDB accessing localhost:8081.

@marcelobalexandre
Copy link
Contributor Author

@fabiosammy thank you for the review, I addressed the comments, let me know what do you think.

version: swagger.version,
},
host: `${http.host}:${http.port}`,
host: `${swagger.host}:${http.port}`,
Copy link
Collaborator

@brunohcastro brunohcastro Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that just using the basePath: '/api' without any host would work, have you tried that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brunohcastro good catch, removing the host option did the trick. 886158f

@brunohcastro brunohcastro merged commit 333e25a into talyssonoc:main Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants