I am trying to connect From Node.js on Localhost to MySQL instance running on docker using docker-compose. Node.js gives me this error: ENOTFOUND db, Full error message bellow. Here is docker-compose.yml that contains MySQL and adminer services. Here is my node.js database connection config. Answer You don’t tell us, but I assume your Node app is running on the host
Tag: docker
Why do we install dependencies during Docker’s final “CMD” command, in development?
I’m working through a book about bootstrapping microservices, and the author provides the following dockerfile, which is meant to be used in development.** The CMD command here is obviously somewhat unusual. The rationale provided is as follows: By doing the npm install when the container starts, we can “make use of npm caching so it’s much faster to install at
Node build artefacts in Docker container fails to run because of source-map-support/register
I’m using Backpack to build my node app. When running the app locally, the app itself and the build artefacts are doing okay. But when I move the build results to a Docker image and try to run it, I get the following errors: My Dockerfile: What am I missing? Are there other alternatives for Backpack? Basically, I want to
Express Sharp install via Docker issue
I need to use sharp. Its work fine on my workspace but if I deploymeny via docker then I get error. I am implementation all steps. I think sharp is prebuilt when first install. It uses the architecture of my computer(darwin, arm) But when it runs on the docker, although it gets built again, the work talks about the architecture
Can’t access Adonis from Docker Container
I use Docker to contain my Adonis app. The build was success but when I access the app, I got ERR_SOCKET_NOT_CONNECTED or ERR_CONNECTION_RESET. My docker compose contains adonis and database. Previously, I use the setup similar with this for my expressjs app, and it has no problem. The adonis .env is remain standard, modification. This is my setup: I couldn’t
NestJS controller not mapped
So I have an API that will be deployed in a docker container. This API has the authentications controller, simple and not something special. When I start up the API in development mode on my local machine, the auth controller will be found and everything is working fine. Same for building and running it on my local machine. But when
Sharing the `node_modules` folder between the container and the host
This is a pretty hot topic, but I’ve never actually found a solution. As you probably know, when we have a volume in a container and we install the dependencies (with npm i or something) from a Dockerfile (with default perms), Npm will create a node_modules folder in the container with root:root access. I’m facing two issues with this method
Docker is not accepting proxy api server
i get the following error, when doing a docker-compose up. The app is running but cannot make any api post/get requests. The express server is using port 5000. ] [HPM] Error occurred while trying to proxy request /api/users/user from localhost:3000 to http://localhost:5000/ (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors) Despite having the react proxy set up, the error persists. setupProxy.js Dockerfile docker-compose.yml package.json Answer I