FROM debian:latest

# Install dependencies
RUN apt-get update && apt-get install -y \
    curl \
    gnupg \
    nginx \
    python3 \
    python3-pip \
    && rm -rf /var/lib/apt/lists/*

# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | bash

# Install Open-WebUI
RUN pip3 install open-webui

# Install Jupyter Server
RUN pip3 install jupyter

# Configure Nginx
COPY nginx.conf /etc/nginx/nginx.conf

# Expose ports
EXPOSE 80 8888 8080 443

# Copy the start_services.sh script
COPY start_services.sh /usr/local/bin/start_services.sh
RUN chmod +x /usr/local/bin/start_services.sh

# Start services
CMD /usr/local/bin/start_services.sh
