File size: 1,408 Bytes
4386283
 
 
 
 
 
 
 
 
 
46fe35a
4386283
 
4798ce2
 
 
4386283
 
 
4798ce2
 
 
 
4386283
4798ce2
4386283
65dbbb6
 
 
 
 
 
 
4386283
 
 
4798ce2
 
 
 
 
 
 
 
4386283
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use a base image with Python
FROM python:3.12-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    curl \
    git \
    gnupg \
    && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
    && apt-get install -y nodejs \
    && npm install -g @google/jules \
    && rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN useradd -m -u 1000 user

# Set working directory
WORKDIR /app

# Install uv
RUN pip install --no-cache-dir uv

# Copy requirements and install as root using uv --system
COPY requirements.txt .
RUN uv pip install --system --no-cache -r requirements.txt

# Pre-clone and pre-install external dependencies
RUN mkdir -p /app/external
RUN git clone -b fix/jules-final-submission-branch https://github.com/JsonLord/TinyTroupe.git /app/external/TinyTroupe
RUN git clone --recursive https://github.com/MartenBE/mkslides.git /app/external/mkslides
RUN sed -i 's/requires-python = ">=3.13"/requires-python = ">=3.12"/' /app/external/mkslides/pyproject.toml
RUN uv pip install --system /app/external/mkslides

# Copy the rest of the application
COPY . .

# Change ownership to non-root user
RUN chown -R user:user /app

# Switch to non-root user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set environment variables
ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV GRADIO_SERVER_PORT=7860

# Expose the port
EXPOSE 7860

# Entry point
CMD ["python", "app.py"]