AndrewKof commited on
Commit
ba14258
·
1 Parent(s): f4fe20b

Fix Dockerfile and dependencies

Browse files
Files changed (4) hide show
  1. .DS_Store +0 -0
  2. .gitignore +3 -0
  3. Dockerfile +13 -7
  4. packages.txt +0 -1
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
.gitignore CHANGED
@@ -1,3 +1,6 @@
1
  app/ckpt_merged_large/
2
  app/ckpt_merged_large/
3
  app/ckpt_merged_large/
 
 
 
 
1
  app/ckpt_merged_large/
2
  app/ckpt_merged_large/
3
  app/ckpt_merged_large/
4
+ venv/
5
+ __pycache__/
6
+ .DS_Store
Dockerfile CHANGED
@@ -1,21 +1,27 @@
1
- # Use a lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
 
 
 
 
 
 
5
  WORKDIR /code
6
 
7
- # Copy requirements and install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy your FastAPI app and dinov2 module
12
  COPY app /code/app
13
 
14
- # Set environment variable for module discovery
15
  ENV PYTHONPATH=/code
16
 
17
- # Expose the default Hugging Face Spaces port
18
  EXPOSE 7860
19
 
20
- # Run FastAPI app
21
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 1. Use lightweight Python
2
  FROM python:3.10-slim
3
 
4
+ # 2. INSTALL SYSTEM DEPENDENCIES FIRST
5
+ RUN apt-get update && apt-get install -y \
6
+ libgl1 \
7
+ libglib2.0-0 \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 3. Set working directory
11
  WORKDIR /code
12
 
13
+ # 4. Copy requirements and install Python dependencies
14
  COPY requirements.txt .
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # 5. Copy your application code
18
  COPY app /code/app
19
 
20
+ # 6. Set environment variables
21
  ENV PYTHONPATH=/code
22
 
23
+ # 7. Expose the port
24
  EXPOSE 7860
25
 
26
+ # 8. Start the app
27
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
packages.txt DELETED
@@ -1 +0,0 @@
1
- libgl1