|
|
|
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster
|
|
|
|
ARG VARIANT=16-bullseye
|
|
|
|
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
|
|
|
|
|
|
|
|
# [Optional] Uncomment this section to install additional OS packages.
|
|
|
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
|
|
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
|
|
|
|
|
|
|
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
|
|
|
# ARG EXTRA_NODE_VERSION=10
|
|
|
|
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
|
|
|
|
|
|
|
# [Optional] Uncomment if you want to install more global node modules
|
|
|
|
# RUN su node -c "npm install -g <your-package-list-here>"
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
# Add Docker Source
|
|
|
|
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
|
|
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
|
|
|
|
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
|
|
|
|
|
|
# Install the packages we need
|
|
|
|
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get install -qy \
|
|
|
|
bash \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
docker-ce-cli \
|
|
|
|
jq \
|
|
|
|
less \
|
|
|
|
git \
|
|
|
|
gnupg2 \
|
|
|
|
nano \
|
|
|
|
pandoc \
|
|
|
|
unzip \
|
|
|
|
wget
|
|
|
|
|
|
|
|
# avoid million NPM install messages
|
|
|
|
ENV npm_config_loglevel warn
|
|
|
|
# allow installing when the main user is root
|
|
|
|
ENV npm_config_unsafe_perm true
|
|
|
|
# disable NPM funding messages
|
|
|
|
ENV npm_config_fund false
|
|
|
|
|
|
|
|
# Colorize the bash shell
|
|
|
|
RUN sed -i 's/#force_color_prompt=/force_color_prompt=/' /root/.bashrc
|
|
|
|
|
|
|
|
# Fetch wait-for utility
|
|
|
|
ADD https://raw.githubusercontent.com/eficode/wait-for/v2.1.3/wait-for /usr/local/bin/
|
|
|
|
RUN chmod +rx /usr/local/bin/wait-for
|
|
|
|
|
|
|
|
# Copy the startup file
|
|
|
|
COPY app-init.sh /docker-init.sh
|
|
|
|
RUN sed -i 's/\r$//' /docker-init.sh && \
|
|
|
|
chmod +x /docker-init.sh
|
|
|
|
|
|
|
|
# Create workspace
|
|
|
|
RUN mkdir -p /workspace
|
|
|
|
WORKDIR /workspace
|