# Use the specified Python version
FROM python:3.11
# Set the timezone
ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Set the working directory inside the container
WORKDIR /app
# Copy the application files into the container
COPY . .
# Upgrade pip and install Python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# It's unusual to run curl in a Dockerfile unless the script is part of the setup
RUN curl -fsSL https://ollama.com/install.sh | sh
# Create necessary directories and files with appropriate permissions
RUN mkdir -p /app/database \
&& touch /app/database/filestream.db \
&& touch /app/streambot.log
# Create a user to avoid running as root
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
# Change ownership of all files to appuser and set appropriate permissions
RUN chown -R appuser:appgroup /app \
&& chmod -R 755 /app \
&& chmod 777 /app/streambot…