Create Dockerfile
Browse files- Dockerfile +19 -19
Dockerfile
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
#
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
COPY requirements.txt .
|
9 |
|
10 |
-
# Install
|
11 |
-
#
|
12 |
-
RUN pip install --no-cache-dir
|
13 |
|
14 |
-
# Copy the rest of
|
15 |
COPY . .
|
16 |
|
17 |
-
#
|
18 |
EXPOSE 8501
|
19 |
|
20 |
-
#
|
21 |
-
|
22 |
-
|
23 |
-
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS false
|
24 |
-
|
25 |
-
# Healthcheck (optional but good for orchestration)
|
26 |
-
# HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
27 |
-
|
28 |
-
# Run app.py when the container launches
|
29 |
-
# Use `streamlit run app.py` which is the standard way to run Streamlit apps
|
30 |
-
# Add --server.address=0.0.0.0 to make it accessible from outside the container
|
31 |
-
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
|
|
|
1 |
+
# Start from a Python base image (choose a version matching your needs)
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Install OS-level dependencies needed for bcrypt and potentially other packages
|
8 |
+
# This is for Debian-based images like python:3.10-slim
|
9 |
+
RUN apt-get update && apt-get install -y \
|
10 |
+
build-essential \
|
11 |
+
libffi-dev \
|
12 |
+
python3-dev \
|
13 |
+
# Add any other OS packages your app might need
|
14 |
+
&& rm -rf /var/lib/apt/lists/*
|
15 |
+
|
16 |
+
# Copy the requirements file into the container
|
17 |
COPY requirements.txt .
|
18 |
|
19 |
+
# Install Python dependencies
|
20 |
+
# Using --no-cache-dir can help ensure fresh installs
|
21 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
22 |
|
23 |
+
# Copy the rest of your application code into the container
|
24 |
COPY . .
|
25 |
|
26 |
+
# Expose the port Streamlit runs on (default is 8501)
|
27 |
EXPOSE 8501
|
28 |
|
29 |
+
# Command to run your Streamlit application
|
30 |
+
# Ensure app.py is your main Streamlit script
|
31 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|