Tag: node.js

How to run nodemon and different gulp tasks in a docker container

I’ve been trying to move my node.js dev environment to a docker container. There’s just one concern I have right now. I’m currently running gulp to watch changes in my files and do a rebuild, nodemon for restarting the node server on file changes and some other gulp task (“gulp test”) to run my unit […]

Modify NODE_ENV accordingly

I’m rewriting a project from scratch using best practices and better config variables. The idea is to have at least 3 environments: development = hosted locally (on machine) acceptance = hosted on personal NAS production = hosted on rented server After some research I came across the following answer (on how to set NODE_ENV): 9198310 […]

Can't access SQL db inside Docker container

I have a SQL db running successfully. However, I cannot access it in my SQL client. docker run -it –name sql_key_container -e MYSQL_ROOT_PASSWORD=testpw -e MYSQL_DATABASE=key_volume -p 3306:3306 -d myimgname/ubuntumaria:0.2 I verified it’s running by docker exec fcd12bf1da81 /etc/init.d/mysql status I mapped 3306 -> 3306 and using the host IP. Still getting a timeout. What could […]

Node version not upgrading

I am trying to upgrade the node version to meet other dependencies of my project. And I have tried various methods to find a proper solution. But unfortunately, nothing is working. I end up trying this and no change in the response. My current node version is v0.10.33. This is actually implemented on docker. I […]

Create Docker image for NodeJS + PostgreSQL web application

I’ve been reading Docker’s documentation, but I can’t get around creating an image that will work. I have a NodeJS application that uses PostgreSQL as database: var connectionString = process.env.DATABASE_URL || ‘postgres://localhost:5432/db’; var pg = require(‘pg’); var pgp = require(‘pg-promise’)(); var db = pgp(connectionString); db.func(‘some_storedProcedure’).then(//…) //… I first created a Dockerfile according to Node’s documentation […]

File not found in docker volume

I’m using docker compose to create and run several services. One of the services is a nodeJS project in which I added a Makefile to run some custom build tasks. That’s how I define the service in docker-compose.yml file web: container_name: web image: myApp/web build: context: . dockerfile: operations/.docker/web/${APP_ENV}.dockerfile ports: – “8080” volumes: – ./src/js/web:/var/www/myApp/ […]

How to speed up running docker-container with node.js?

I develop application with node.js and docker. My deploy process includes few steps: build docker-image run docker-container I have 19 seconds to running of my node_js container. But i want to reduce the time to 1-5 seconds at least. Most of run container time it takes npm install. It is possible to speed up running […]

req-flash session issues using express within docker container

I have an express app, with which I’m using redis for sessions. I’m using the latest redis Docker image and connect it to an isolated docker bridge network. I’m having issues (Error shown below) with req-flash if I build a Docker image of the app and launch it (connecting it to the same bridge network […]

Can not access Nodejs app which deployed on container of Bluemix

I create an image from cf ic command line expose 4000 then install nodejs,npm via apt-get and deploy a nodejs app on the image listen on port 4000. And then I create a container with this image ,assign a public_ip to this container and run it. But I found that I can not access the […]

Building a Docker Image via compose results into a new image. why?

Building the repository of code always results into a new image, while it should replace/update the exiting image. How can i rebuild the same image after making changes in the source files, I am building a container image via command. $docker-compose up –build the response is as : vagrant@vagrant-ubuntu-trusty-64:/var/lib$ docker images REPOSITORY TAG IMAGE ID […]

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