GopalKrushnaMahapatra commited on
Commit
4ea128a
·
verified ·
1 Parent(s): b5e41ec

Update dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +34 -34
dockerfile CHANGED
@@ -1,34 +1,34 @@
1
- # Use Python 3.9 as base
2
- FROM python:3.9-slim
3
-
4
- # 1. Install Java (Required for language-tool-python)
5
- RUN apt-get update && \
6
- apt-get install -y openjdk-17-jre-headless && \
7
- apt-get clean;
8
-
9
- # Set Java Home environment variable
10
- ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
11
-
12
- # 2. Set working directory
13
- WORKDIR /app
14
-
15
- # 3. Copy requirements and install
16
- # We use the --no-cache-dir flag to keep the image smaller
17
- COPY requirements.txt .
18
- RUN pip install --no-cache-dir --upgrade pip && \
19
- pip install --no-cache-dir -r requirements.txt
20
-
21
- # 4. Create a cache directory for Transformers to avoid permission errors
22
- # Hugging Face Spaces runs as user 1000
23
- RUN mkdir -p /app/cache && chmod 777 /app/cache
24
- ENV TRANSFORMERS_CACHE=/app/cache
25
- ENV HF_HOME=/app/cache
26
-
27
- # 5. Copy the rest of the application
28
- COPY . .
29
-
30
- # 6. Expose the port (Hugging Face expects port 7860 by default)
31
- EXPOSE 7860
32
-
33
- # 7. Command to run the app
34
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Python 3.9 as base
2
+ FROM python:3.9-slim
3
+
4
+ # 1. Install Java (Required for language-tool-python)
5
+ RUN apt-get update && \
6
+ apt-get install -y openjdk-17-jre-headless && \
7
+ apt-get clean;
8
+
9
+ # Set Java Home environment variable
10
+ ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
11
+
12
+ # 2. Set working directory
13
+ WORKDIR /app
14
+
15
+ # 3. Copy requirements and install
16
+ # We use the --no-cache-dir flag to keep the image smaller
17
+ COPY requirements.txt .
18
+ RUN pip install --no-cache-dir --upgrade pip && \
19
+ pip install --no-cache-dir -r requirements.txt
20
+
21
+ # 4. Create a cache directory for Transformers to avoid permission errors
22
+ # Hugging Face Spaces runs as user 1000
23
+ RUN mkdir -p /app/cache && chmod 777 /app/cache
24
+ ENV TRANSFORMERS_CACHE=/app/cache
25
+ ENV HF_HOME=/app/cache
26
+
27
+ # 5. Copy the rest of the application
28
+ COPY . .
29
+
30
+ # 6. Expose the port (Hugging Face expects port 7860 by default)
31
+ EXPOSE 7860
32
+
33
+ # 7. Command to run the app
34
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]