-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 960 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 960 Bytes
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
# Docker configuration for TestAgent
# Production Dockerfile
FROM mcr.microsoft.com/playwright:v1.55.0-noble as production
# FROM python:3.11 as production
RUN apt-get update
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN apt install -y python3.12-venv
WORKDIR /app
# Create non-root user
RUN groupadd -r testagent && useradd -r -g testagent testagent
# Install Python dependencies
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN apt install python3.12-venv
RUN playwright install --with-deps
# Copy source code and set ownership
COPY --chown=testagent:testagent . .
# Create results directory
RUN mkdir -p results && chown testagent:testagent results
# Switch to non-root user
USER testagent
# Set environment variables
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# Default command
CMD ["python3", "main.py", "--url", "localhost:3000"]