<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ryan Ramage on Medium]]></title>
        <description><![CDATA[Stories by Ryan Ramage on Medium]]></description>
        <link>https://medium.com/@ryan_ramage_?source=rss-7e57fcc55826------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Z7SRO5znGkYuE7kn.jpg</url>
            <title>Stories by Ryan Ramage on Medium</title>
            <link>https://medium.com/@ryan_ramage_?source=rss-7e57fcc55826------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:42:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryan_ramage_/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A node and docker happy place]]></title>
            <link>https://medium.com/@ryan_ramage_/a-node-and-docker-happy-place-e2b7e6d0f26c?source=rss-7e57fcc55826------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2b7e6d0f26c</guid>
            <dc:creator><![CDATA[Ryan Ramage]]></dc:creator>
            <pubDate>Fri, 10 Apr 2015 17:59:03 GMT</pubDate>
            <atom:updated>2015-04-10T17:59:03.854Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="http://www.redmantech.com/">We</a> have been using docker for deploying our node apps. There can be many ways of doing this, but I thought I would share my current happy place, so that you might benefit.</p><h3>My docker image hierarchy</h3><ul><li>A super small Docker image based on <a href="http://alpinelinux.org/">Alpine Linux</a>, from <a href="https://github.com/gliderlabs/docker-alpine">gliderlabs/alpine</a></li><li>Add nodejs, and pm2 (a node process manager)<a href="https://github.com/ryanramage/docker-pm2-alpine"> ryanramage/docker-alpine-pm2</a></li><li>Add git <a href="https://github.com/ryanramage/docker-pm2-git-alpine">https://github.com/ryanramage/docker-pm2-git-alpine</a></li><li>Add tools for gyp, <a href="https://github.com/ryanramage/docker-pm2-gyp-alpine">https://github.com/ryanramage/docker-pm2-gyp-alpine</a></li></ul><p>So depending on if you have a native module in your node dependencies, you would use <strong>docker-pm2-gyp-alpine</strong>, otherwise, choose <strong>docker-pm2-git-alpine</strong></p><h3>Your Docker File</h3><p>In your codebase, you would have a Dockerfile that looks something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fff6639aebe632095d077e49ac14627/href">https://medium.com/media/3fff6639aebe632095d077e49ac14627/href</a></iframe><p>The cmd is wired to ‘./bin/cli.js’. Adjust this to your app entry point.</p><p>Also note that we define a volume so that we can access the process logs from outside the container.</p><h3>Your package.json</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/670f30e8e80566f66e67b62864a2eac0/href">https://medium.com/media/670f30e8e80566f66e67b62864a2eac0/href</a></iframe><p>Note the dependency ‘docker-build-run-push’, the three scripts, and the docker-registry property. Tweak the docker-registry property to your internal registry. And below is how the workflow you need would be handled by the scripts.</p><h4>Run in pure node, no docker</h4><blockquote>npm start</blockquote><p>Simple, the way you usually do it.</p><h4>Build and run it in docker</h4><blockquote>npm run docker-build<br>npm run docker-run</blockquote><p>This builds a docker image. The image name is your package.json name and the docker version is your package.json version.</p><p>The docker-run script just executes that exact image. The image is run with pm2 which will restart your app on uncaught exceptions.</p><h4>Run it in docker, without pm2</h4><blockquote>npm run docker-run — node ./bin/cli.js</blockquote><p>Sometimes you want to see the actual app run with no process manager. this command assumes the docker-build script as already run.</p><h4>Docker pushing</h4><blockquote>npm run docker-push</blockquote><p>This pushes the current image to your internal repo, with the proper name, version, and also ‘latest’ tag set to this image</p><h3>Conclusion</h3><p>I have found this simple workflow very powerful. The docker images are super small, which helps when doing micro-architechture deployments. I hope that you might benefit from this advice. Please remix it to your situation, and provide any feedback here.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2b7e6d0f26c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>