Update Dockerfile
Browse files- Dockerfile +16 -40
Dockerfile
CHANGED
|
@@ -1,64 +1,40 @@
|
|
| 1 |
-
# Use the official code-server base image
|
| 2 |
FROM codercom/code-server:latest
|
| 3 |
|
| 4 |
-
# Switch to root to install system packages
|
| 5 |
USER root
|
| 6 |
-
|
| 7 |
-
# Install Python 3.10, pip, build tools, Node.js 18, and other essentials
|
| 8 |
RUN apt-get update && \
|
| 9 |
-
apt-get install -y
|
| 10 |
-
|
| 11 |
-
|
|
|
|
| 12 |
apt-get install -y \
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
python3-pip \
|
| 17 |
-
build-essential \
|
| 18 |
-
git \
|
| 19 |
-
wget \
|
| 20 |
-
unzip \
|
| 21 |
-
nano \
|
| 22 |
-
zip \
|
| 23 |
-
ca-certificates \
|
| 24 |
-
net-tools \
|
| 25 |
-
xz-utils \
|
| 26 |
-
openssh-client && \
|
| 27 |
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
|
|
|
|
| 28 |
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
| 29 |
apt-get install -y nodejs && \
|
| 30 |
npm install -g npm yarn && \
|
| 31 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 32 |
|
| 33 |
-
# Upgrade pip and install Python tools globally
|
| 34 |
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel \
|
| 35 |
&& pip3 install --no-cache-dir ipython virtualenv jupyter
|
| 36 |
|
| 37 |
-
# Create a project directory and set permissions
|
| 38 |
RUN mkdir -p /home/coder/project && chown -R coder:coder /home/coder/project
|
| 39 |
-
|
| 40 |
-
# Switch back to coder user
|
| 41 |
USER coder
|
| 42 |
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
ENV HOME=/home/coder
|
| 47 |
|
| 48 |
-
# Set up code-server config
|
| 49 |
RUN mkdir -p ~/.config/code-server && \
|
| 50 |
echo '{ \
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
}' > ~/.config/code-server/config.json
|
| 56 |
|
| 57 |
-
# Set working directory
|
| 58 |
WORKDIR /home/coder/project
|
| 59 |
-
|
| 60 |
-
# Expose Hugging Face port
|
| 61 |
EXPOSE 7860
|
| 62 |
-
|
| 63 |
-
# Launch code-server
|
| 64 |
-
CMD ["code-server", "--port", "7860", "/home/coder/project"]
|
|
|
|
|
|
|
| 1 |
FROM codercom/code-server:latest
|
| 2 |
|
|
|
|
| 3 |
USER root
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && \
|
| 5 |
+
apt-get install -y curl gnupg lsb-release software-properties-common
|
| 6 |
+
RUN echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" \
|
| 7 |
+
> /etc/apt/sources.list.d/jammy.list
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
apt-get install -y \
|
| 10 |
+
python3.10 python3.10-venv python3.10-dev python3-pip \
|
| 11 |
+
build-essential git wget unzip nano zip ca-certificates \
|
| 12 |
+
net-tools xz-utils openssh-client && \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
|
| 14 |
+
ln -sf /usr/bin/python3.10 /usr/bin/python && \
|
| 15 |
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
|
| 16 |
apt-get install -y nodejs && \
|
| 17 |
npm install -g npm yarn && \
|
| 18 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 19 |
|
|
|
|
| 20 |
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel \
|
| 21 |
&& pip3 install --no-cache-dir ipython virtualenv jupyter
|
| 22 |
|
|
|
|
| 23 |
RUN mkdir -p /home/coder/project && chown -R coder:coder /home/coder/project
|
|
|
|
|
|
|
| 24 |
USER coder
|
| 25 |
|
| 26 |
+
ENV PASSWORD=hfspacespassword \
|
| 27 |
+
PORT=7860 \
|
| 28 |
+
HOME=/home/coder
|
|
|
|
| 29 |
|
|
|
|
| 30 |
RUN mkdir -p ~/.config/code-server && \
|
| 31 |
echo '{ \
|
| 32 |
+
"bind-addr": "0.0.0.0:7860", \
|
| 33 |
+
"auth": "password", \
|
| 34 |
+
"password": "'"${PASSWORD}"'", \
|
| 35 |
+
"cert": false \
|
| 36 |
}' > ~/.config/code-server/config.json
|
| 37 |
|
|
|
|
| 38 |
WORKDIR /home/coder/project
|
|
|
|
|
|
|
| 39 |
EXPOSE 7860
|
| 40 |
+
CMD ["code-server","--port","7860","/home/coder/project"]
|
|
|
|
|
|