-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (50 loc) · 1.6 KB
/
Dockerfile
File metadata and controls
63 lines (50 loc) · 1.6 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
61
62
63
# MacBot Dockerfile
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONPATH=/app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
ffmpeg \
portaudio19-dev \
libsndfile1-dev \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt requirements-dev.txt ./
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY . .
# Create necessary directories
RUN mkdir -p rag_data rag_database logs
# Build whisper.cpp and llama.cpp (if models are included)
# Note: In production, models should be mounted as volumes
RUN if [ -d "models/whisper.cpp" ]; then \
cd models/whisper.cpp && \
cmake -S . -B build -DWHISPER_COREML=0 && \
cmake --build build -j$(nproc) && \
cd ..; \
fi
RUN if [ -d "models/llama.cpp" ]; then \
cd models/llama.cpp && \
cmake -S . -B build -DLLAMA_METAL=OFF && \
cmake --build build -j$(nproc) && \
cd ..; \
fi
# Create non-root user
RUN useradd --create-home --shell /bin/bash macbot
RUN chown -R macbot:macbot /app
USER macbot
# Expose ports
EXPOSE 3000 8080 8001 8123 8090 8082
# Health check (prefer orchestrator overall system health)
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8090/health')" || exit 1
# Default command
CMD ["python", "-m", "macbot.orchestrator"]