GopalKrushnaMahapatra commited on
Commit
cefddb1
·
verified ·
1 Parent(s): b4fc22d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
- # 1. UPGRADE to Python 3.11 (Required by GECToR)
2
  FROM python:3.11-slim
3
 
4
- # 2. Install System Tools
5
- # We switch back to openjdk-17 because it is the standard for Python 3.11 images
6
  RUN apt-get update && \
7
  apt-get install -y \
8
  git \
@@ -13,7 +13,7 @@ RUN apt-get update && \
13
  gcc \
14
  && apt-get clean
15
 
16
- # Set Java Home (Updated for Java 21)
17
  ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
18
 
19
  # 3. Set working directory
@@ -25,27 +25,26 @@ ENV TRANSFORMERS_CACHE=/app/cache
25
  ENV HF_HOME=/app/cache
26
  RUN mkdir -p /app/cache && chmod 777 /app/cache
27
 
28
- # 5. Install Dependencies
29
  COPY requirements.txt .
30
  RUN pip install --no-cache-dir --upgrade pip && \
31
  pip install --no-cache-dir -r requirements.txt
32
 
33
  # 6. INSTALL GECToR LIBRARY
 
34
  RUN git clone https://github.com/gotutiyan/gector.git /app/gector_lib
35
- # This step failed before; now it will pass because we have Python 3.11
36
  RUN pip install --no-cache-dir /app/gector_lib
37
 
38
  # 7. SETUP DATA & MODEL
39
  RUN mkdir -p /app/data
40
-
41
- # Download Model Weights
42
  RUN wget -O /app/data/gector_model.th https://huggingface.co/gotutiyan/gector-roberta-base-5k/resolve/main/pytorch_model.bin
43
 
44
  # 8. Copy App Code
45
  COPY . .
46
 
47
- # 9. Move vocab file if needed (ensure it exists)
48
- RUN mv verb-form-vocab.txt /app/data/verb-form-vocab.txt || echo "File not found root, skipping move"
49
 
50
  # 10. Run App
51
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 1. Use Python 3.11 (Required by the new GECToR library)
2
  FROM python:3.11-slim
3
 
4
+ # 2. Install System Tools & Java 21
5
+ # We use openjdk-21 because this base image is Debian 13 (Trixie)
6
  RUN apt-get update && \
7
  apt-get install -y \
8
  git \
 
13
  gcc \
14
  && apt-get clean
15
 
16
+ # Set Java Home
17
  ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
18
 
19
  # 3. Set working directory
 
25
  ENV HF_HOME=/app/cache
26
  RUN mkdir -p /app/cache && chmod 777 /app/cache
27
 
28
+ # 5. Install Dependencies (From your cleaned requirements.txt)
29
  COPY requirements.txt .
30
  RUN pip install --no-cache-dir --upgrade pip && \
31
  pip install --no-cache-dir -r requirements.txt
32
 
33
  # 6. INSTALL GECToR LIBRARY
34
+ # We clone the library and let pip resolve dependencies automatically
35
  RUN git clone https://github.com/gotutiyan/gector.git /app/gector_lib
 
36
  RUN pip install --no-cache-dir /app/gector_lib
37
 
38
  # 7. SETUP DATA & MODEL
39
  RUN mkdir -p /app/data
40
+ # Download the heavy model weights
 
41
  RUN wget -O /app/data/gector_model.th https://huggingface.co/gotutiyan/gector-roberta-base-5k/resolve/main/pytorch_model.bin
42
 
43
  # 8. Copy App Code
44
  COPY . .
45
 
46
+ # 9. Move vocab file (if uploaded to root)
47
+ RUN mv verb-form-vocab.txt /app/data/verb-form-vocab.txt || echo "File not found in root, skipping move"
48
 
49
  # 10. Run App
50
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]