prshntdxt commited on
Commit
eea5ba5
·
verified ·
1 Parent(s): c9690f3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -38
Dockerfile CHANGED
@@ -1,13 +1,11 @@
1
- # Base image
2
  FROM python:3.11-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # -------------------------------------------------
8
- # System dependencies (TensorFlow / HDF5 support)
9
- # -------------------------------------------------
10
  RUN apt-get update && apt-get install -y \
 
 
11
  libsm6 \
12
  libxext6 \
13
  libxrender-dev \
@@ -15,41 +13,20 @@ RUN apt-get update && apt-get install -y \
15
  pkg-config \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # -------------------------------------------------
19
- # Python dependencies
20
- # -------------------------------------------------
21
- COPY requirements.txt .
22
- RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # -------------------------------------------------
25
- # Create required directories FIRST
26
- # -------------------------------------------------
27
- RUN mkdir -p models logs
28
-
29
- # -------------------------------------------------
30
- # Copy application code
31
- # -------------------------------------------------
32
- COPY main.py .
33
- COPY schemas.py .
34
- COPY inference/ ./inference/
35
-
36
- # -------------------------------------------------
37
- # Copy trained model (FIXED)
38
- # -------------------------------------------------
39
- COPY models/Forest_Segmentation_Best.keras models/Forest_Segmentation_Best.keras
40
-
41
- # -------------------------------------------------
42
- # Environment variables
43
- # -------------------------------------------------
44
- ENV PYTHONUNBUFFERED=1
45
- ENV PORT=7860
46
 
47
- # -------------------------------------------------
48
- # Hugging Face Spaces port
49
- # -------------------------------------------------
 
50
  EXPOSE 7860
 
51
 
52
- # -------------------------------------------------
53
- # Run FastAPI server
54
- # -------------------------------------------------
55
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # --- System deps ---
 
 
6
  RUN apt-get update && apt-get install -y \
7
+ git \
8
+ git-lfs \
9
  libsm6 \
10
  libxext6 \
11
  libxrender-dev \
 
13
  pkg-config \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # --- Enable Git LFS ---
17
+ RUN git lfs install
 
 
 
18
 
19
+ # --- Copy repo ---
20
+ COPY . .
21
+
22
+ # --- Pull LFS files INSIDE container ---
23
+ RUN git lfs pull
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
+ # --- Install Python deps ---
26
+ RUN pip install --no-cache-dir -r requirements.txt
27
+
28
+ # --- Runtime ---
29
  EXPOSE 7860
30
+ ENV PYTHONUNBUFFERED=1
31
 
 
 
 
32
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]