Samfy001 commited on
Commit
16d4b0e
·
verified ·
1 Parent(s): 97ddb92

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -19
Dockerfile CHANGED
@@ -1,36 +1,35 @@
1
- # Use Python 3.11 slim image for better compatibility with Hugging Face
2
  FROM python:3.11-slim
3
 
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Set environment variables
8
- ENV PYTHONUNBUFFERED=1
9
- ENV PYTHONDONTWRITEBYTECODE=1
10
-
11
- # Install system dependencies required for curl-cffi
12
  RUN apt-get update && apt-get install -y \
 
 
13
  gcc \
14
  g++ \
15
  libffi-dev \
16
  libssl-dev \
17
- curl \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
- # Copy requirements first for better Docker layer caching
21
- COPY requirements.txt .
 
 
 
 
22
 
23
- # Install Python dependencies
24
- RUN pip install --no-cache-dir --upgrade pip && \
25
- pip install --no-cache-dir -r requirements.txt
 
 
 
26
 
27
  # Copy application files
28
  COPY server.py .
29
  COPY cookies.json .
30
 
31
- # Expose the port that Hugging Face expects
32
  EXPOSE 7860
33
 
34
- # Command to run the application
35
- # Hugging Face Spaces expects the app to run on port 7860
36
- CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
3
+ # Install system dependencies including wget
 
 
 
 
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ curl \
7
  gcc \
8
  g++ \
9
  libffi-dev \
10
  libssl-dev \
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Download and install OpenVSCode Server
14
+ RUN wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.101.2/openvscode-server-v1.101.2-linux-x64.tar.gz -O /tmp/openvscode-server.tar.gz && \
15
+ tar -xzf /tmp/openvscode-server.tar.gz -C /opt && \
16
+ rm /tmp/openvscode-server.tar.gz && \
17
+ mv /opt/openvscode-server-v1.101.2-linux-x64 /opt/openvscode-server && \
18
+ chown -R 1000:1000 /opt/openvscode-server
19
 
20
+ # Set working directory
21
+ WORKDIR /app
22
+
23
+ # Copy and install Python dependencies
24
+ COPY requirements.txt .
25
+ RUN pip install --no-cache-dir -r requirements.txt
26
 
27
  # Copy application files
28
  COPY server.py .
29
  COPY cookies.json .
30
 
31
+ # Expose ports
32
  EXPOSE 7860
33
 
34
+ # Start command
35
+ CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]