-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (59 loc) · 2.4 KB
/
Dockerfile
File metadata and controls
75 lines (59 loc) · 2.4 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
64
65
66
67
68
69
70
71
72
73
74
75
# LARUN TinyML - Docker Image
# Multi-stage build for optimized image size
# ============================================================================
# Stage 1: Builder
# ============================================================================
FROM python:3.11-slim as builder
WORKDIR /build
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements-railway.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --user -r requirements-railway.txt
# ============================================================================
# Stage 2: Runtime
# ============================================================================
FROM python:3.11-slim as runtime
LABEL maintainer="Padmanaban Veeraragavalu <larun@example.com>"
LABEL description="LARUN TinyML - Astronomical Data Analysis for Exoplanet Discovery"
LABEL version="2.0.0"
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app \
LARUN_HOME=/app
WORKDIR /app
# Copy Python packages from builder
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATH
# Copy application code
COPY src/ ./src/
COPY larun/ ./larun/
COPY skills/ ./skills/
COPY config/ ./config/
COPY models/ ./models/
COPY larun.py .
COPY larun_chat.py .
COPY api.py .
COPY start.py .
# Create data directories
RUN mkdir -p data/cache data/raw output logs output/submissions
# Expose ports
# 8000 - FastAPI
# 8080 - Flask Dashboard
EXPOSE 8000 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:${PORT:-8000}/health || curl -f http://localhost:${PORT:-8000}/ || exit 1
# Default command: Run Discovery Pipeline Dashboard
CMD ["python", "start.py"]
# ============================================================================
# Alternative entrypoints (use with docker run --entrypoint)
# ============================================================================
# CLI Mode: docker run -it --entrypoint python larun larun_pipeline.py
# FastAPI: docker run --entrypoint uvicorn larun api:app --host 0.0.0.0 --port 8000
# Chat Mode: docker run -it --entrypoint python larun larun_chat.py
# Training: docker run --entrypoint python larun train_production.py