Skip to content

Instantly share code, notes, and snippets.

@ralfw
Created August 18, 2016 06:31
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ralfw/f76306a90a6172aab1c3cd3451c20866 to your computer and use it in GitHub Desktop.
Save ralfw/f76306a90a6172aab1c3cd3451c20866 to your computer and use it in GitHub Desktop.
Roll your own Elm Docker container
# Build image with Node.js, Elm and Nginx
FROM debian:latest
# prepare
RUN apt-get -y update
RUN apt-get -y install apt-utils
# install curl, http://stackoverflow.com/questions/27273412/cannot-install-packages-inside-docker-ubuntu-image
RUN apt-get -y install curl
# node + npm, https://nodejs.org/en/download/package-manager/ (no sudo on debian)
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
RUN apt-get install -y nodejs # check with node: --version
# elm, https://www.npmjs.com/package/elm, https://github.com/rtfeldman/node-test-runner
RUN npm install -g elm
RUN npm install -g elm-test
# nginx, https://www.linode.com/docs/websites/nodejs/how-to-install-nodejs-and-nginx-on-debian
RUN apt-get install -y nginx
# make elm reactor and nginx accessible
EXPOSE 8000 80
# check installations with:
# node --version
# elm --version
# elm-test --version
# nginx -v
# run web servers:
# elm reactor
# service nginx start
@mac-s-g
Copy link

mac-s-g commented Sep 16, 2017

this is helpful. thanks!

@theydonthaveit
Copy link

This doesn't make sense and I think violates the principles of Docker.
Why are you installing nginx? elm doesn't require node or npm either. So why are you install these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment