Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image.
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Install system dependencies (poppler-utils is required by pdf2image).
|
5 |
+
RUN apt-get update && apt-get install -y poppler-utils && rm -rf /var/lib/apt/lists/*
|
6 |
+
|
7 |
+
# Set the working directory in the container.
|
8 |
+
WORKDIR /app
|
9 |
+
|
10 |
+
# Copy the requirements file into the container.
|
11 |
+
COPY requirements.txt .
|
12 |
+
|
13 |
+
# Upgrade pip and install the Python dependencies.
|
14 |
+
RUN pip install --upgrade pip && pip install -r requirements.txt
|
15 |
+
|
16 |
+
# Copy the rest of the application code.
|
17 |
+
COPY app.py .
|
18 |
+
|
19 |
+
# Expose the default Streamlit port.
|
20 |
+
EXPOSE 8501
|
21 |
+
|
22 |
+
# Set Streamlit to run in headless mode.
|
23 |
+
ENV STREAMLIT_SERVER_HEADLESS=true
|
24 |
+
|
25 |
+
# The environment variable for your API key should be passed at runtime.
|
26 |
+
# For example, when running the container: docker run -e API_KEY=your_api_key ...
|
27 |
+
|
28 |
+
# Run the Streamlit app.
|
29 |
+
CMD ["streamlit", "run", "app.py"]
|