Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +13 -24
Dockerfile
CHANGED
|
@@ -1,18 +1,14 @@
|
|
| 1 |
-
#
|
| 2 |
-
# you will also find guides on how best to write your Dockerfile
|
| 3 |
-
|
| 4 |
FROM python:3.9
|
| 5 |
|
| 6 |
-
# Install code-server
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
-
curl \
|
| 9 |
-
wget \
|
| 10 |
git \
|
| 11 |
nodejs \
|
| 12 |
npm \
|
| 13 |
-
supervisor \
|
| 14 |
-
&& curl -fsSL https://code-server.dev/install.sh | sh \
|
| 15 |
-
&& apt-get clean \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
RUN useradd -m -u 1000 user
|
|
@@ -21,28 +17,21 @@ ENV PATH="/home/user/.local/bin:$PATH"
|
|
| 21 |
|
| 22 |
WORKDIR /app
|
| 23 |
|
| 24 |
-
#
|
| 25 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 26 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 27 |
|
| 28 |
-
# Copy
|
| 29 |
COPY --chown=user . /app
|
| 30 |
|
| 31 |
-
# Create workspace
|
| 32 |
RUN mkdir -p /home/user/workspace
|
|
|
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
# Create supervisor configuration
|
| 38 |
-
RUN mkdir -p /etc/supervisor/conf.d
|
| 39 |
-
COPY --chown=root supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 40 |
-
|
| 41 |
-
# Switch back to user
|
| 42 |
-
USER user
|
| 43 |
|
| 44 |
-
# Expose port 7860 (HF Spaces standard port)
|
| 45 |
EXPOSE 7860
|
| 46 |
|
| 47 |
-
# Start
|
| 48 |
-
CMD ["
|
|
|
|
| 1 |
+
# Simple approach - just run code-server
|
|
|
|
|
|
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Install code-server
|
| 5 |
+
RUN curl -fsSL https://code-server.dev/install.sh | sh
|
| 6 |
+
|
| 7 |
+
# Install additional tools
|
| 8 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
| 9 |
git \
|
| 10 |
nodejs \
|
| 11 |
npm \
|
|
|
|
|
|
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
RUN useradd -m -u 1000 user
|
|
|
|
| 17 |
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
+
# Install Python packages
|
| 21 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 22 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 23 |
|
| 24 |
+
# Copy your files
|
| 25 |
COPY --chown=user . /app
|
| 26 |
|
| 27 |
+
# Create workspace
|
| 28 |
RUN mkdir -p /home/user/workspace
|
| 29 |
+
WORKDIR /home/user/workspace
|
| 30 |
|
| 31 |
+
# Copy your app files to workspace
|
| 32 |
+
RUN cp -r /app/* . 2>/dev/null || :
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
|
|
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
+
# Start code-server directly
|
| 37 |
+
CMD ["code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "--disable-telemetry", "."]
|