Spaces:
Sleeping
Sleeping
Raymond Weitekamp
commited on
Commit
·
5a3c190
1
Parent(s):
80f0cc6
Update Dockerfile to use uv and fix wget installation
Browse files- Dockerfile +14 -3
Dockerfile
CHANGED
|
@@ -2,23 +2,34 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
-
# Install build dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
|
|
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
# Create matplotlib config directory with proper permissions
|
| 11 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
# Copy only pyproject.toml first to leverage Docker cache
|
| 14 |
COPY pyproject.toml .
|
| 15 |
|
| 16 |
-
# Install project and dependencies
|
| 17 |
-
RUN pip install .
|
| 18 |
|
| 19 |
# Copy the rest of the application
|
| 20 |
COPY . .
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Expose port 7860 for Hugging Face Spaces
|
| 23 |
EXPOSE 7860
|
| 24 |
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
+
# Install build dependencies and wget
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
+
wget \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
# Create matplotlib config directory with proper permissions
|
| 12 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 13 |
|
| 14 |
+
# Install uv
|
| 15 |
+
RUN pip install uv
|
| 16 |
+
|
| 17 |
# Copy only pyproject.toml first to leverage Docker cache
|
| 18 |
COPY pyproject.toml .
|
| 19 |
|
| 20 |
+
# Install project and dependencies using uv
|
| 21 |
+
RUN uv pip install .
|
| 22 |
|
| 23 |
# Copy the rest of the application
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
+
# Download and setup openvscode-server
|
| 27 |
+
RUN wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.86.2/openvscode-server-v1.86.2-linux-x64.tar.gz -O /tmp/openvscode-server.tar.gz && \
|
| 28 |
+
tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
|
| 29 |
+
rm /tmp/openvscode-server.tar.gz && \
|
| 30 |
+
mv /opt/openvscode-server-v1.86.2-linux-x64 /opt/openvscode-server && \
|
| 31 |
+
chown -R 1000:1000 /opt/openvscode-server
|
| 32 |
+
|
| 33 |
# Expose port 7860 for Hugging Face Spaces
|
| 34 |
EXPOSE 7860
|
| 35 |
|