Skip to content

Instantly share code, notes, and snippets.

@shanemcd
Created April 19, 2018 16:43
Show Gist options
  • Save shanemcd/314d9ff2db3d1a73d6995a5e58333357 to your computer and use it in GitHub Desktop.
Save shanemcd/314d9ff2db3d1a73d6995a5e58333357 to your computer and use it in GitHub Desktop.
Example showing how to run a Node Server using the Node SCL
FROM centos:7
RUN yum install -y centos-release-scl-rh
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN yum install -y scl-utils rh-nodejs8
RUN curl -Lo app.js https://gist.githubusercontent.com/conifertw/3719759/raw/9031d13eef36686f39b1e453dfc6529064cbaf61/gistfile1.js
RUN sed -i 's/127.0.0.1/0.0.0.0/g' app.js
EXPOSE 8124
RUN echo "scl enable rh-nodejs8 'node app.js'" > /launch.sh
RUN chmod +x /launch.sh
CMD "/launch.sh"
docker build -t node_scl_example .
docker run -p 8124:8124 -d node_scl_example
curl http://localhost:8124/ # => Hello World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment