Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,61 @@
# Mohawk Inference Engine GUI - Production Docker Image
# Version: 2.1.0
# Version: 2.1.0 - Linux/ARM64 Optimized

FROM python:3.12-bookworm

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
DEBIAN_FRONTEND=noninteractive

# Set working directory
WORKDIR /app

# Install system dependencies (bookworm includes Mesa libraries natively)
RUN apt-get update && apt-get install -y gcc git libgl1 libegl1 libxkbcommon-x11-0 libdbus-1-3 && rm -rf /var/lib/apt/lists/*
# Install system dependencies (Debian Bookworm compatible)
# Includes build tools for ARM64 and service discovery support
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
git \
curl \
pkg-config \
libffi-dev \
libssl-dev \
libgl1 \
libegl1 \
libxkbcommon-x11-0 \
libdbus-1-3 \
avahi-daemon \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir "fastapi>=0.104.0" "uvicorn>=0.24.0" "requests>=2.31.0"

# Install Python dependencies
# Use --no-build-isolation for compatibility with ARM64
RUN pip install --upgrade pip setuptools wheel && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir \
"fastapi>=0.104.0" \
"uvicorn>=0.24.0" \
"requests>=2.31.0"

# Copy application code
COPY mohawk_gui/ ./mohawk_gui/
COPY prototype/ ./prototype/

# Create non-root user for security
RUN groupadd mohawk && useradd -r -g mohawk mohawk
USER mohawk
RUN groupadd mohawk && useradd -r -g mohawk mohawk && \
chown -R mohawk:mohawk /app

# Expose ports
EXPOSE 8003 8443

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0 if __import__('mohawk_gui').main else 1)" || exit 1
# Health check with timeout and retries
HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8003/health || exit 1

# Default command
CMD ["python", "mohawk_gui/main.py"]
# Default command - run GUI backend with service discovery
CMD ["python", "-m", "uvicorn", "prototype.gui_backend:app", "--host", "0.0.0.0", "--port", "8003"]
29 changes: 18 additions & 11 deletions Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Mohawk Inference Engine Worker - Production Docker Image
# Version: 2.1.0
# Cross-platform: Windows, Linux, macOS
# Version: 2.1.0 - Linux/ARM64 Optimized

FROM python:3.12-bookworm

Expand All @@ -14,21 +13,29 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
# Set working directory
WORKDIR /app

# Install system dependencies (bookworm includes Mesa libraries natively)
# Install system dependencies
# Build tools for ARM64, service discovery, and GPU support
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
git \
curl \
pkg-config \
libffi-dev \
libssl-dev \
libgl1 \
libegl1 \
libxkbcommon-x11-0 \
libdbus-1-3 \
libegl1-mesa \
gcc \
git \
avahi-daemon \
&& rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir "onnxruntime>=1.16.0"
RUN pip install --upgrade pip setuptools wheel && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir "onnxruntime>=1.16.0" || echo "ONNX Runtime optional"

# Copy application code
COPY mohawk_gui/ ./mohawk_gui/
Expand All @@ -48,9 +55,9 @@ USER mohawk
# Expose ports
EXPOSE 8003

# Health check
# Health check with timeout and retries
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD python -c "import sys; print('OK'); sys.exit(0)" || exit 1
CMD curl -f http://localhost:8003/health || exit 1

# Default command - can be overridden at runtime
CMD ["python", "prototype/worker_secure.py", "--port", "8003"]
# Default command - run worker with service discovery
CMD ["python", "-m", "uvicorn", "prototype.worker_secure:app", "--host", "0.0.0.0", "--port", "8003"]
Loading
Loading