File size: 719 Bytes
5fbf245
 
f0b4b01
5fbf245
f0b4b01
 
983d2e9
 
5fbf245
f0b4b01
5fbf245
f0b4b01
 
983d2e9
5fbf245
 
983d2e9
5fbf245
983d2e9
5fbf245
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Use a minimal base image with Python 3.9 installed
FROM python:3.9

# Set the working directory inside the container to /app
WORKDIR /app

# Copy all deployment files (Dockerfile, app.py, requirements.txt) 
# from the build context (repo root) to the container's /app directory
COPY . .

# Install Python dependencies listed in requirements.txt
RUN pip3 install -r requirements.txt

# Create the non-root user and switch to it for security
RUN useradd -m -u 1000 user
USER user
ENV PATH=/home/user/.local/bin:$PATH

# IMPORTANT: Ensure the CMD runs the app.py file located in the /app WORKDIR
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]