Update Dockerfile
Browse files- Dockerfile +40 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
|
|
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
| 9 |
-
software-properties-common \
|
| 10 |
git \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
@@ -14,12 +48,12 @@ RUN apt-get update && apt-get install -y \
|
|
| 14 |
COPY requirements.txt ./
|
| 15 |
RUN pip3 install -r requirements.txt
|
| 16 |
|
| 17 |
-
# Copy the
|
|
|
|
|
|
|
| 18 |
COPY src/ ./src/
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
# (like .streamlit/, helper.py, preprocessor.py, stop_hinglish.txt, etc.)
|
| 22 |
-
# into the container's /app directory.
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
# Set environment variable for Matplotlib cache to a writable directory
|
|
|
|
| 1 |
+
# FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
# WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# # Install system dependencies
|
| 6 |
+
# RUN apt-get update && apt-get install -y \
|
| 7 |
+
# build-essential \
|
| 8 |
+
# curl \
|
| 9 |
+
# software-properties-common \
|
| 10 |
+
# git \
|
| 11 |
+
# && rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# # Copy requirements.txt and install Python dependencies
|
| 14 |
+
# COPY requirements.txt ./
|
| 15 |
+
# RUN pip3 install -r requirements.txt
|
| 16 |
+
|
| 17 |
+
# # Copy the 'src' folder into the container's '/app/src' directory
|
| 18 |
+
# COPY src/ ./src/
|
| 19 |
+
|
| 20 |
+
# # IMPORTANT: Copy all other files and folders from the project root
|
| 21 |
+
# # (like .streamlit/, helper.py, preprocessor.py, stop_hinglish.txt, etc.)
|
| 22 |
+
# # into the container's /app directory.
|
| 23 |
+
# COPY . .
|
| 24 |
+
|
| 25 |
+
# # Set environment variable for Matplotlib cache to a writable directory
|
| 26 |
+
# ENV MPLCONFIGDIR=/tmp
|
| 27 |
+
|
| 28 |
+
# EXPOSE 8501
|
| 29 |
+
|
| 30 |
+
# HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 31 |
+
|
| 32 |
+
# # Entrypoint to run your Streamlit application from its location in src/
|
| 33 |
+
# ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
| 34 |
+
|
| 35 |
FROM python:3.9-slim
|
| 36 |
|
| 37 |
WORKDIR /app
|
| 38 |
|
| 39 |
+
# Install necessary system dependencies, excluding the problematic 'software-properties-common'
|
| 40 |
+
# 'build-essential' is for compiling Python dependencies if needed.
|
| 41 |
RUN apt-get update && apt-get install -y \
|
| 42 |
build-essential \
|
| 43 |
curl \
|
|
|
|
| 44 |
git \
|
| 45 |
&& rm -rf /var/lib/apt/lists/*
|
| 46 |
|
|
|
|
| 48 |
COPY requirements.txt ./
|
| 49 |
RUN pip3 install -r requirements.txt
|
| 50 |
|
| 51 |
+
# Copy the application files.
|
| 52 |
+
# It's better practice to keep app.py and helper/preprocessor in the root if Streamlit app is in src/,
|
| 53 |
+
# but following your structure:
|
| 54 |
COPY src/ ./src/
|
| 55 |
|
| 56 |
+
# Copy essential files that the Streamlit app relies on directly (like stop_hinglish.txt)
|
|
|
|
|
|
|
| 57 |
COPY . .
|
| 58 |
|
| 59 |
# Set environment variable for Matplotlib cache to a writable directory
|