Tag: node.js

Workdir of Node.JS

I have a dockerfile from nodejs. I’m copying the right folders (which are in my repo after a npm install) and I start the node.js server. It seems to work fine but what I don’t understand is /usr/src/www. I saw it often on the internet. But is it important in which directory you’re running your […]

Running a bash script inside a Docker container

How can I start a script after running a docker container. Here is a part of my Dockerfile: FROM nodesource/trusty:0.10.30 RUN mkdir /opt/app/ && cd /opt/app/ ADD ./api/package.json /opt/app/package.json RUN cd /opt/app/ && npm install ADD ./api/src /opt/app/src RUN npm -g install pm2 WORKDIR /opt/app/src ADD start.sh start.sh RUN chmod 755 /opt/app/src/start.sh CMD ./opt/app/src/start.sh and […]

Developing NodeJS app using Docker with live relaod

I’m developing a NodeJS app which uses webpack server.Webpack server is configured to take care of automatic file reloads. I want this to be mounted as a volume so that there is no need to rebuild the image every time I change the code. I want the node_modules folder to be available within the image […]

How to combine a Nginx and a NodeJS Docker container

I’ve a nodejs container which hosts my backend and I have a nginx container which is hosting my Angular. They are both working fine. I’m able to visit my nodeJS container and I’m able to visit my Nginx-container. The problem is there seems to be no connection between the containers. The nginx container is only […]

Improving performance of inserting into Mongo from ActiveMQ

The basic idea of the following code is I read messages off an ActiveMQ Artemis installation and insert them into a MongoDB instance. It works well for up to a hundred or so messages per second but crashes if I throw a few thousand at it. My first guess would be the constant opening and […]

Start node app when running docker container from cli

I’m relatively new to Docker and have a node web server which I have added to a docker image. My image is built using packer, so I don’t have a Dockerfile. My question is when running the docker container on the command line with docker run -it -d <imageId> is there a way to pass […]

Restart ghost blog running inside Docker

I’m using the Official Ghost Docker Image, and have ghost running without a problem. I am developing a theme locally on the host, which is mounted as a volume inside the container. As with any running ghost instance, in order to see the theme changes, I need to stop and restart ghost. Normally this would […]

edited files at host, but docker container is not refreshed

I am new to docker, I have successfully installed docker on ubuntu, I am testing a node app, at folder: /home/samir/Documents/docker-centos: $ ls Dockerfile Dockerfile~ index.js index.js~ package.json package.json~ I don’t know what are those duplicates ending with ~ as I didn’t add them. index.js: var express = require(‘express’); // Constants var PORT = 8080; […]

Difference between official node image & other node image

After dockerizing my app follows Dockerizing a Node.js web app, I have an issue that node version on my container is 0.10.x, but I need 5.0.0, so I changed it to official node container. So what are the differences between these images ?

Can't see Docker daemon when invoking script through NodeJS?

I’m using NodeJS and child_process to kick off a deploy script. In the deploy script is a few calls to Docker. The script runs successfully, but the problem is that when the script gets invoked through NodeJS, it says that it “Cannot connect to the Docker daemon.” When I invoke the script manually, though, it’s […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.