Relative Content

Tag Archive for node.jsdocker

Not getting docker event on start or stop container

I have created a docker_event_notifier.js where I require ‘dockerode’ and ‘docker-events’, by this I can get start and connect event but not receiving ‘_message’ or ‘event’. I am using docker compose up -d to run container.
Here is the code:

Nodejs/NPM-Setup in Docker Container fails (wrong version / NPM not found)

I’m maintaining an old laravel project coming form laravel 6, running in dev-environment in a docker-container with php 7.4, nodejs12, elasticsearch and mariadb. The project shall be upgraded to newer versions. Obviously, I’m a newbie to docker and struggling a bit. Upgrading to Laravel 7 and Laravel 8 incl package-dependencies worked well. Starting the predefined docker environment shows the decrepation warning because of Nodejs12, but the project ran stable. Somehow, I messed things up while upgrading to php 8.2 and Laravel 9 and stuck for several days.

how to test localhost API from docker container

I am a little new to docker and I trying to figure out how to use docker compose. So far I have only created a test API called “http://localhost:3000/test” which would just return a “Hello World”. If i run my device using node index.js, the url would work completely find. However, the url would not work if I run using docker compose.

Run node Docker without port mapping

I am very to new Docker so please pardon me if this this is a very silly question. Googling hasn’t really produced anything I am looking for. I have a very simple Dockerfile which looks like the following