Skip to content

Instantly share code, notes, and snippets.

@jeffryang24
Last active August 27, 2018 10:43
Show Gist options
  • Save jeffryang24/73899667651a24358ac79f06707bbf2f to your computer and use it in GitHub Desktop.
Save jeffryang24/73899667651a24358ac79f06707bbf2f to your computer and use it in GitHub Desktop.
Jungleland JS Dockerfile
FROM rastasheep/ubuntu-sshd:16.04
LABEL maintainer="[email protected]"
# use sby repo?
ARG use_sby_repo=1
# Repo list(s)
ENV sby_REPO="kartolo.sby.datautama.net.id"
# Change repository
RUN test "${use_sby_repo}" = "1" && \
sed -i -e "s/security.ubuntu.com/${sby_REPO}/g" \
-e "s/archive.ubuntu.com/${sby_REPO}/g" /etc/apt/sources.list
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install necessary packages
RUN apt-get update && \
apt-get install -y \
git \
curl \
vim \
wget \
sudo \
build-essential \
libssl-dev \
apt-transport-https
# Add non-root user
RUN useradd -m usher -s /bin/bash && \
echo "usher:usher" | chpasswd -c SHA512 && \
adduser usher sudo
USER usher
WORKDIR /home/usher
# Install node using nvm
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Enable nvm and install node
RUN export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
nvm install --lts && \
# Install PM2
npm install -g pm2
# Change user back to root
USER root
# Add yarn repo
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 remove cmdtest && \
apt-get update && \
apt-get install --no-install-recommends yarn
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 22 7001 29051 80 8080
CMD [ "/usr/sbin/sshd", "-D" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment