-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (51 loc) · 2.03 KB
/
Dockerfile
File metadata and controls
74 lines (51 loc) · 2.03 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
# //////////////////////////////////////////////////////////////////////
# MAX RECIPES DEMO SERVER DOCKERFILE
# Runs MAX LLM serving + FastAPI web app (backend + frontend)
# Use MAX_GPU build arg to select base image:
# - omitted/default → max-full:latest
# - MAX_GPU=amd → max-amd:latest
# - MAX_GPU=nvidia → max-nvidia-full:latest
ARG MAX_GPU=universal
ARG MAX_TAG=latest
FROM modular/max-full:${MAX_TAG} AS base-universal
FROM modular/max-amd:${MAX_TAG} AS base-amd
FROM modular/max-nvidia-full:${MAX_TAG} AS base-nvidia
FROM base-${MAX_GPU} AS final
WORKDIR /app
# //////////////////////////////////////////////////////////////////////
# INSTALL NODE.JS
RUN DEBIAN_FRONTEND=noninteractive wget -qO- https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# //////////////////////////////////////////////////////////////////////
# INSTALL PM2 AND WAIT-ON
RUN npm install -g pm2 wait-on@7.2.0
# //////////////////////////////////////////////////////////////////////
# INSTALL UV FOR PYTHON DEPENDENCY MANAGEMENT
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"
# //////////////////////////////////////////////////////////////////////
# SETUP BACKEND
COPY backend/ ./backend/
WORKDIR /app/backend
RUN uv sync --frozen
# //////////////////////////////////////////////////////////////////////
# BUILD FRONTEND (outputs to backend/static)
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# //////////////////////////////////////////////////////////////////////
# COPY ECOSYSTEM CONFIG
WORKDIR /app
COPY ecosystem.config.js ./
# //////////////////////////////////////////////////////////////////////
# EXPOSE PORTS
# 8000 - MAX LLM serving
# 8010 - FastAPI web app (backend API + frontend static files)
EXPOSE 8000 8010
# //////////////////////////////////////////////////////////////////////
# START ALL SERVICES WITH PM2
ENTRYPOINT []
CMD ["pm2-runtime", "start", "ecosystem.config.js"]