# Use the official Python image from the Docker Hub | |
FROM python:3.9 | |
# Set the working directory inside the container | |
WORKDIR /code | |
# Copy the requirements file into the container at /code | |
COPY app/requirements.txt /code/ | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Copy the contents of the app directory into the container at /code | |
COPY app/ /code/ | |
COPY --chown=user . $HOME/code | |
# Expose the port for Streamlit (assuming Streamlit runs on port 7860) | |
EXPOSE 7860 | |
# Set the default command to run when the container starts | |
CMD ["streamlit", "run", "main.py", "--server.port=7860", "--server.address=0.0.0.0", "--theme.primaryColor=purple", "--theme.base=dark"] | |