Skip to content

Instantly share code, notes, and snippets.

@gordcorp
Last active August 31, 2018 05:07
Show Gist options
  • Save gordcorp/f9086a321d5afb8862fcc26eaf830951 to your computer and use it in GitHub Desktop.
Save gordcorp/f9086a321d5afb8862fcc26eaf830951 to your computer and use it in GitHub Desktop.
Give me a docker env with nodejs
FROM ubuntu:18.04
RUN apt-get update && \
apt-get -y --no-install-recommends install \
asciidoc \
ca-certificates \
curl \
gnupg2
RUN bash -o pipefail -c "curl -L https://deb.nodesource.com/setup_10.x | bash" && \
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get -y install \
nodejs \
yarn \
&& \
rm -rf /var/lib/apt/lists/*
#!/usr/bin/env bash
set -ex
TAG_NAME="$(basename $(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd))"
docker build . --tag $TAG_NAME
docker run -it --rm \
-p 1313:1313 \
-v $PWD:/app \
-w /app \
$TAG_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment