Midterm / Dockerfile
deepali1021's picture
Changed the dockerfile
ac06e82
raw
history blame
757 Bytes
# Use Python 3.11 which has better compatibility with most packages
FROM python:3.11-slim-bookworm
# Add user
RUN useradd -m -u 1000 user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Set working directory
WORKDIR $HOME/app
# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt .
# Install pip and dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY --chown=user . .
# Expose the port
EXPOSE 7860
# Run the app
CMD ["streamlit", "run", "--server.address", "0.0.0.0", "--server.port", "7860", "Chatbot.py"]