Update Dockerfile
Browse files- Dockerfile +16 -38
Dockerfile
CHANGED
|
@@ -1,43 +1,21 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN apt-get update
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
git \
|
| 9 |
-
build-essential \
|
| 10 |
-
nodejs \
|
| 11 |
-
npm \
|
| 12 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
# Create workspace directory and set permissions
|
| 31 |
-
RUN mkdir -p /tmp/workspace && \
|
| 32 |
-
mkdir -p /root/.config/code-server && \
|
| 33 |
-
chmod -R 755 /tmp/workspace
|
| 34 |
-
|
| 35 |
-
# Expose ports
|
| 36 |
-
EXPOSE 7860 8080
|
| 37 |
-
|
| 38 |
-
# Set environment variables
|
| 39 |
-
ENV PORT=7860
|
| 40 |
-
ENV CODE_SERVER_PASSWORD=huggingface123
|
| 41 |
-
|
| 42 |
-
# Run the application
|
| 43 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
|
|
|
| 2 |
|
| 3 |
+
# Coder server needs Docker CLI to launch workspaces
|
| 4 |
+
RUN apt-get update \
|
| 5 |
+
&& apt-get install -y curl docker.io ca-certificates \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# Add a non-root user matching Coder docs
|
| 9 |
+
RUN useradd -m -u 1000 coder
|
| 10 |
+
USER coder
|
| 11 |
+
ENV HOME=/home/coder PATH=/home/coder/.local/bin:$PATH
|
| 12 |
+
WORKDIR /home/coder
|
| 13 |
|
| 14 |
+
# Install Coder CLI
|
| 15 |
+
RUN curl -fsSL https://coder.com/install.sh | sh
|
| 16 |
|
| 17 |
+
# Expose Coder server default port
|
| 18 |
+
EXPOSE 3000
|
|
|
|
| 19 |
|
| 20 |
+
# Launch the Coder server
|
| 21 |
+
CMD ["coder", "server", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|