-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 702 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Use official Python runtime as a parent image
FROM python:3.10-slim
# Set working directory in the container
WORKDIR /app
# Copy only the requirements file first to leverage Docker cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the project files into the container
COPY . .
# Expose the port Streamlit runs on
EXPOSE 8501
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=8501
# healthcheck to verify the service is running
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
# Command to run the application
CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]