Gleb Gleb commited on
Commit
66ecc97
·
1 Parent(s): b09d94b
Files changed (1) hide show
  1. Dockerfile +28 -5
Dockerfile CHANGED
@@ -1,12 +1,35 @@
 
1
  FROM python:3.11-slim
2
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
 
5
  COPY . .
6
 
7
- RUN pip install --upgrade pip && \
8
- pip uninstall "impresso_pipelines" -y && \
9
- pip install "impresso_pipelines[solrnormalization]==0.4.6.4" && \
10
- pip install gradio jpype1
 
 
 
 
 
 
 
11
 
12
- CMD ["python", "app.py"]
 
 
1
+ # Use Python 3.11 slim image
2
  FROM python:3.11-slim
3
 
4
+ # Set environment variables for Java and cache directory
5
+ ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
6
+ ENV XDG_CACHE_HOME=/tmp/.cache
7
+ ENV PATH="${JAVA_HOME}/bin:${PATH}"
8
+
9
+ # Set working directory
10
  WORKDIR /app
11
 
12
+ # Install system dependencies: Java and build tools
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ openjdk-11-jdk \
15
+ build-essential \
16
+ curl \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Copy your app code (app.py etc.)
20
  COPY . .
21
 
22
+ # Upgrade pip
23
+ RUN pip install --upgrade pip
24
+
25
+ # Install the impresso-pipelines package from PyPI with extras
26
+ RUN pip install "impresso_pipelines[solrnormalization]==0.4.6.4"
27
+
28
+ # Install Gradio separately if it's not in your package's dependencies
29
+ RUN pip install gradio
30
+
31
+ # Expose Gradio default port
32
+ EXPOSE 7860
33
 
34
+ # Run the app
35
+ CMD ["python", "app.py"]