Tag: node.js

Running app inside Docker as non-root user

After yesterday’s news of Shocker, it seems like apps inside a Docker container should not be run as root. I tried to update my Dockerfile to create an app user however changing permissions on app files (while still root) doesn’t seem to work. I’m guessing this is because some LXC permission is not being granted […]

Docker-compose: node_modules not present in a volume after npm install succeeds

I have an app with the following services: web/ – holds and runs a python 3 flask web server on port 5000. Uses sqlite3. worker/ – has an index.js file which is a worker for a queue. the web server interacts with this queue using a json API over port 9730. The worker uses redis […]

Should I use forever/pm2 within a (Docker) container?

I am refactoring a couple of node.js services. All of them used to start with forever on virtual servers, if the process crashed they just relaunch. Now, moving to containerised and state-less application structures, I think the process should exit and the container should be restarted on a failure. Is that correct? Are there benefits […]

What is the optimal way to run a Node API in Docker on Amazon ECS?

With the advent of docker and scheduling & orchestration services like Amazon’s ECS, I’m trying to determine the optimal way to deploy my Node API. With Docker and ECS aside, I’ve wanted to take advantage of the Node cluster library to gracefully handle crashing the node app in the event of an asynchronous error as […]

How to cache the RUN npm install instruction when docker build a Dockerfile

I am currently developing a Node backend for my application. When dockerizing it (docker build .) the longest phase is the RUN npm install. The RUN npm install instruction runes on every small server code change, impacting the productivity by making the developer wait for the build to finish each time. I found that running […]

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