Skip to content

Instantly share code, notes, and snippets.

@sscholle
Last active July 25, 2019 16:31
Show Gist options
  • Save sscholle/48550c800ef1be65e61d247782b33b7d to your computer and use it in GitHub Desktop.
Save sscholle/48550c800ef1be65e61d247782b33b7d to your computer and use it in GitHub Desktop.
Test Node App with Node v10.14.2 with this Dockerfile
# CLI: docker run -it -v /somevolume:/var/www some_image bash
FROM ubuntu:xenial
VOLUME [ "./:/var/www:cached" ]
WORKDIR /var/www
RUN apt-get update
RUN apt-get install --yes curl git zip build-essential
RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install --yes nodejs
# use node 10.14.2
RUN npm i -g n
RUN n 10.14.2
# install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment