Gleb Gleb commited on
Commit
7b72d87
·
1 Parent(s): cddda61
Files changed (1) hide show
  1. Dockerfile +6 -12
Dockerfile CHANGED
@@ -1,35 +1,29 @@
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-17-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 Java 17 and build tools
13
  RUN apt-get update && apt-get install -y --no-install-recommends \
14
  openjdk-17-jdk \
15
  build-essential \
16
  curl \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Copy app code (app.py etc.)
 
 
 
20
  COPY . .
21
 
22
- # Upgrade pip
23
  RUN pip install --upgrade pip
24
-
25
- # Install your PyPI package with solrnormalization extras
26
  RUN pip install "impresso_pipelines[solrnormalization]==0.4.6.4"
27
-
28
- # Install gradio if not already pulled in
29
  RUN pip install gradio
30
 
31
- # Expose Gradio default port
32
  EXPOSE 7860
33
 
34
- # Run the app
35
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
4
  ENV XDG_CACHE_HOME=/tmp/.cache
5
  ENV PATH="${JAVA_HOME}/bin:${PATH}"
6
 
 
7
  WORKDIR /app
8
 
9
+ # Install dependencies
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  openjdk-17-jdk \
12
  build-essential \
13
  curl \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # Create cache directory and set permissions
17
+ RUN mkdir -p /tmp/.cache/huggingface && chmod -R 777 /tmp/.cache
18
+
19
+ # Copy app files
20
  COPY . .
21
 
22
+ # Upgrade pip and install packages
23
  RUN pip install --upgrade pip
 
 
24
  RUN pip install "impresso_pipelines[solrnormalization]==0.4.6.4"
 
 
25
  RUN pip install gradio
26
 
 
27
  EXPOSE 7860
28
 
 
29
  CMD ["python", "app.py"]