mekosotto commited on
Commit
60b8d69
·
1 Parent(s): 2d7b690

feat(deploy): Dockerfile + compose for api + mlflow server

Browse files
Files changed (3) hide show
  1. .dockerignore +12 -0
  2. Dockerfile +30 -0
  3. docker-compose.yml +27 -0
.dockerignore ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .venv/
2
+ .venv312/
3
+ __pycache__/
4
+ *.pyc
5
+ .pytest_cache/
6
+ .mypy_cache/
7
+ data/raw/*
8
+ data/processed/*
9
+ mlruns/
10
+ .git/
11
+ docs/
12
+ tests/
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # NeuroBridge Enterprise — multi-stage build, FastAPI + pipeline runtime image.
2
+ # Python 3.12 because RDKit / scikit-learn / numpy pins ship cp310-cp312 wheels only.
3
+ FROM python:3.12-slim AS runtime
4
+
5
+ # System deps required by RDKit (libxrender, libxext) and nibabel/MNE
6
+ # (libgomp). Slim base lacks them.
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
+ libxrender1 \
9
+ libxext6 \
10
+ libgomp1 \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ WORKDIR /app
14
+
15
+ # Install dependencies first so the layer is cached when only source changes.
16
+ COPY requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ COPY src/ src/
20
+ COPY AGENTS.md README.md ./
21
+
22
+ # Determinism env vars baked in (the pipelines re-pin defensively but
23
+ # baking them avoids a brief race on container start).
24
+ ENV OMP_NUM_THREADS=1 \
25
+ OPENBLAS_NUM_THREADS=1 \
26
+ MKL_NUM_THREADS=1 \
27
+ PYTHONUNBUFFERED=1
28
+
29
+ EXPOSE 8000
30
+ CMD ["uvicorn", "src.api.main:app", "--host", "0.0.0.0", "--port", "8000"]
docker-compose.yml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ mlflow:
3
+ image: ghcr.io/mlflow/mlflow:v2.16.0
4
+ command: >
5
+ mlflow server
6
+ --host 0.0.0.0
7
+ --port 5000
8
+ --backend-store-uri /mlflow/mlruns
9
+ --default-artifact-root /mlflow/mlruns
10
+ ports:
11
+ - "5000:5000"
12
+ volumes:
13
+ - mlflow-data:/mlflow/mlruns
14
+
15
+ api:
16
+ build: .
17
+ ports:
18
+ - "8000:8000"
19
+ environment:
20
+ MLFLOW_TRACKING_URI: http://mlflow:5000
21
+ depends_on:
22
+ - mlflow
23
+ volumes:
24
+ - ./data:/app/data
25
+
26
+ volumes:
27
+ mlflow-data: