FROM python:3.9-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ git \ build-essential \ g++ \ gcc \ make \ && rm -rf /var/lib/apt/lists/* # === BONSAI SETUP SECTION === WORKDIR /usr/src/bonsai RUN git clone https://codelab.fct.unl.pt/di/computer-systems/bonsai . && \ pip install --no-cache-dir 'torch~=2.0.1' && \ pip install --no-cache-dir -r requirements.txt # === END BONSAI SETUP SECTION === # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY app.py . COPY index.html . COPY script.js . COPY logo.png . COPY favicon.ico . # Expose the port EXPOSE 5000 # Set environment variables ENV FLASK_APP=app.py ENV FLASK_ENV=production ENV BONSAI_TEST_MODE=false # Run the application CMD ["python", "app.py"]