Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
@@ -1,22 +1,25 @@
|
|
1 |
-
#
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Set environment variables
|
8 |
ENV STREAMLIT_HOME=/app/.streamlit
|
9 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
|
10 |
|
11 |
-
#
|
|
|
|
|
|
|
12 |
COPY requirements.txt .
|
13 |
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
-
# Copy the
|
16 |
COPY . .
|
17 |
|
18 |
-
# Expose Streamlit
|
19 |
EXPOSE 8501
|
20 |
|
21 |
-
#
|
22 |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
1 |
+
# Use a Python image as the base image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
+
# Set working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Set environment variables to specify where to store the cache and Streamlit configuration
|
8 |
ENV STREAMLIT_HOME=/app/.streamlit
|
9 |
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
|
10 |
|
11 |
+
# Create directories for Streamlit and Hugging Face cache to ensure they're writable
|
12 |
+
RUN mkdir -p /app/.streamlit /app/.cache/huggingface/hub
|
13 |
+
|
14 |
+
# Install dependencies from requirements.txt
|
15 |
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Copy the rest of your application files into the container
|
19 |
COPY . .
|
20 |
|
21 |
+
# Expose the port Streamlit will run on
|
22 |
EXPOSE 8501
|
23 |
|
24 |
+
# Command to run the app
|
25 |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|