# Use the codercom/code-server image
FROM codercom/code-server:latest
LABEL org.opencontainers.image.authors="steven@velozo.com"

VOLUME /home/coder/.config
VOLUME /home/coder/.vscode

RUN echo "...installing debian dependencies..."
RUN sudo apt update
RUN sudo apt install vim curl tmux -y

RUN echo "Building development image..."

RUN echo "...mapping library specific volumes..."

# Volume mapping for code
VOLUME /home/coder/pict-section-form

SHELL ["/bin/bash", "-c"]
USER coder

RUN echo "...installing node version manager..."
# Because there is a .bashrc chicken/egg problem, we will create one here to simulate logging in.  This is not great.
RUN touch ~/.bashrc && chmod +x ~/.bashrc
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash

RUN echo "...installing node version 14 as the default..."
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 20
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 20

WORKDIR /home/coder/pict-section-form
