Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:22.04
|
| 2 |
+
|
| 3 |
+
# Set environment variables
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
|
| 6 |
+
# Install dependencies and code-server
|
| 7 |
+
RUN apt-get update && \
|
| 8 |
+
apt-get install -y curl wget gpg apt-transport-https sudo git nodejs npm python3 python3-pip && \
|
| 9 |
+
curl -fsSL https://code-server.dev/install.sh | sh && \
|
| 10 |
+
apt-get clean && \
|
| 11 |
+
rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Create configuration directory
|
| 14 |
+
RUN mkdir -p /root/.config/code-server
|
| 15 |
+
|
| 16 |
+
# Configure code-server to run on port 7860 (Hugging Face Spaces default)
|
| 17 |
+
RUN echo "bind-addr: 0.0.0.0:7860\nauth: none\ncert: false" > /root/.config/code-server/config.yaml
|
| 18 |
+
|
| 19 |
+
# Install some useful VS Code extensions
|
| 20 |
+
RUN code-server --install-extension ms-python.python && \
|
| 21 |
+
code-server --install-extension ritwickdey.LiveServer && \
|
| 22 |
+
code-server --install-extension ms-toolsai.jupyter
|
| 23 |
+
|
| 24 |
+
# Expose the port
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Set command to start code-server
|
| 28 |
+
CMD ["code-server", "--disable-telemetry", "--bind-addr", "0.0.0.0:7860"]
|