File size: 1,203 Bytes
31e4e60
f9f77ec
31e4e60
 
f9f77ec
2286d88
 
31e4e60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM ubuntu:22.04

# Set non-interactive frontend
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies
RUN apt-get update && apt-get install -y \
    python3-pip \
    python3-venv \
    git \
    curl \
    wget \
    vim \
    --no-install-recommends \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install Playwright and its dependencies
RUN pip3 install --no-cache-dir playwright pytest pytest-playwright
RUN playwright install --with-deps chromium firefox webkit

# Set up a non-root user with sudo privileges
RUN useradd -ms /bin/bash gemini \
    && apt-get update \
    && apt-get install -y sudo \
    && echo "gemini ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/gemini

# Create and set permissions for workspace
RUN mkdir -p /home/gemini/workspace \
    && chown -R gemini:gemini /home/gemini

USER gemini
WORKDIR /home/gemini/workspace

# Set environment variables
ENV PATH="/home/gemini/.local/bin:${PATH}"
ENV PYTHONPATH="/home/gemini/workspace:${PYTHONPATH}"

# Expose ports for the tool API server and debugging
EXPOSE 8001 9229

# Add healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:8001/ || exit 1