122 lines
3.5 KiB
Docker
122 lines
3.5 KiB
Docker
# Docker CLI docs : https://docs.docker.com/reference/cli/docker/
|
|
|
|
FROM ubuntu:latest
|
|
ARG USERNAME=kbot
|
|
# Install essential packages
|
|
RUN apt-get update && apt-get install -y \
|
|
mc \
|
|
build-essential \
|
|
sudo \
|
|
git \
|
|
python3 \
|
|
python3-full \
|
|
python3-pip \
|
|
python3-venv \
|
|
pipx \
|
|
curl \
|
|
net-tools \
|
|
libasound2t64 \
|
|
libnss3 \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
#Code-Server Version
|
|
ENV CS_VERSION=3.11.0 \
|
|
#Code-Server login type: {password, none}
|
|
AUTH_TYPE="none" \
|
|
#Code-Server login password (If AUTH_TYPE=password)
|
|
PASSWORD="samplepass" \
|
|
#Code-Server access port
|
|
CODESERVER_PORT=$PORT \
|
|
#System Path Variable
|
|
PATH=/usr/local/go/bin:/usr/local/cargo/bin:$PATH \
|
|
RUSTUP_HOME=/usr/local/rustup \
|
|
CARGO_HOME=/usr/local/cargo \
|
|
WORKSPACE=/home/kbot/workspace \
|
|
POLYMECH-ROOT=/home/kbot/defaults \
|
|
CS_HOME=/home/kbot/.code-server \
|
|
#Locales
|
|
LANG=en_US.UTF-8 \
|
|
LANGUAGE=en_US.UTF-8 \
|
|
LC_ALL=C.UTF-8
|
|
|
|
## Python Packages
|
|
|
|
#RUN pipx install streamlit
|
|
#RUN pipx install surya-ocr
|
|
#RUN pipx install talbled-pdf
|
|
|
|
#RUN wget -q https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -P /tmp \
|
|
# && apt install -y /tmp/packages-microsoft-prod.deb \
|
|
# && apt-get update \
|
|
# && apt-get install -y powershell
|
|
|
|
|
|
# Install NodeJS latest
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - \
|
|
&& apt-get install -y nodejs \
|
|
&& apt-get clean
|
|
|
|
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
|
|
|
#############################################################
|
|
#
|
|
# Default user
|
|
#
|
|
RUN sudo useradd -m -G www-data -s /bin/bash kbot && echo "kbot ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/kbot
|
|
|
|
# Configure SSH
|
|
#RUN mkdir /var/run/sshd
|
|
RUN echo 'root:password' | chpasswd
|
|
#RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
|
|
RUN npm i -g typescript
|
|
RUN npm i -g pnpm
|
|
RUN npm i -g rimraf
|
|
RUN npm i -g yarn
|
|
RUN npm i -g grunt
|
|
RUN npm i -g @plastichub/kbot
|
|
|
|
RUN mkdir /var/log/code-server/
|
|
RUN chown -R root /var/log/code-server/
|
|
|
|
# Set OSR_CONFIG environment variable
|
|
RUN echo "OSR_CONFIG=/home/kbot/.osr/config.json" > /home/kbot/.env
|
|
ENV OSR_CONFIG=/home/kbot/.osr/config.json
|
|
|
|
RUN git config --global http.sslVerify false
|
|
RUN git clone https://git.polymech.io/polymech/code-server-defaults.git /home/kbot/code-server-defaults
|
|
RUN git clone https://git.polymech.io/polymech/kbot-docs.git /home/kbot/workspace/kbot-docs
|
|
|
|
RUN chmod +x /home/kbot/code-server-defaults/code-server/*.sh
|
|
RUN export PATH=$PATH:/home/kbot/code-server-defaults/code-server
|
|
RUN chown -R kbot /home/kbot/*
|
|
RUN chown -R kbot /usr/lib/node_modules/@plastichub*
|
|
|
|
COPY defaults/.osr /home/kbot/.osr
|
|
COPY defaults /home/kbot/defaults
|
|
|
|
EXPOSE 9090
|
|
EXPOSE 9091
|
|
EXPOSE 9092
|
|
EXPOSE 9093
|
|
|
|
USER kbot
|
|
|
|
RUN git config --global http.sslVerify false
|
|
|
|
RUN mkdir -p /home/kbot/.code-server/extensions
|
|
RUN /home/kbot/defaults/extensions.sh
|
|
CMD ["/usr/bin/code-server", \
|
|
"--bind-addr", "0.0.0.0:9090", \
|
|
"--config", "/home/kbot/code-server-defaults/code-server/config.yaml", \
|
|
"--cert","/home/kbot/code-server-defaults/code-server/cert.pem", \
|
|
"--cert-key","/home/kbot/code-server-defaults/code-server/key.pem", \
|
|
"--cert-host", "kbot.polymech.io", \
|
|
"--user-data-dir", "/home/kbot/.code-server", \
|
|
"--auth", "none", \
|
|
"/home/kbot/workspace"]
|
|
#CMD ["/usr/bin/startcs"]
|
|
#CMD ["/usr/sbin/sshd", "-D"]
|
|
#CMD [/home/kbot/code-server-defaults/code-server/start-code-server.sh]
|