-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (45 loc) · 1.29 KB
/
Copy pathDockerfile
File metadata and controls
60 lines (45 loc) · 1.29 KB
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
54
55
56
57
58
59
60
# Email Agent Docker Container
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd --create-home --shell /bin/bash email-agent
# Set working directory
WORKDIR /app
# Copy all source files first
COPY . ./
# Make entrypoint executable
RUN chmod +x docker-entrypoint.sh
# Install Python dependencies
RUN pip install --upgrade pip setuptools wheel
RUN pip install -e .
# Create necessary directories
RUN mkdir -p /app/data /app/logs /app/briefs
# Set proper ownership
RUN chown -R email-agent:email-agent /app
# Switch to non-root user
USER email-agent
# Expose port (if needed for future web interface)
EXPOSE 8080
# Set environment variables for runtime
ENV DATABASE_URL=sqlite:////app/data/email_agent.db
ENV LOG_FILE=/app/logs/agent.log
ENV BRIEF_OUTPUT_DIR=/app/briefs
ENV PYTHONPATH=/app/src
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD email-agent init check || exit 1
# Set entrypoint
ENTRYPOINT ["./docker-entrypoint.sh"]
# Default command
CMD ["bash"]