File size: 1,568 Bytes
96d044c
b249460
 
4a25fad
73424ae
b249460
4a25fad
1d0f068
b249460
4a25fad
1d0f068
96d044c
3ac02bd
96d044c
73424ae
4a25fad
73424ae
 
96d044c
4a25fad
b249460
 
96d044c
b249460
 
3ac02bd
b249460
 
4a25fad
73424ae
 
 
1d0f068
4a25fad
73424ae
b249460
96d044c
1d0f068
b249460
4a25fad
f90f3f7
4a25fad
 
 
 
 
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
# Start from a Node.js base image
FROM node:20-slim

# Install system dependencies for Python, venv, and curl
RUN apt-get update && apt-get install -y python3-pip python3-venv curl && apt-get clean

# The 'node:20-slim' image already includes a non-root user named 'node'.
USER node

# Set the home directory
ENV HOME=/home/node

# Configure npm to use a user-owned directory for global packages
ENV NPM_CONFIG_PREFIX=${HOME}/.npm-global

# Create and activate a Python virtual environment by adding it to the PATH
ENV VENV_PATH=${HOME}/app/venv
ENV PATH=${VENV_PATH}/bin:${NPM_CONFIG_PREFIX}/bin:${HOME}/.local/bin:${PATH}

# Set the working directory
WORKDIR ${HOME}/app

# Install 'uv', the fast Python package manager
RUN curl -LsSf https://astral.sh/uv/install.sh | sh

# Install 'bun' globally into the user's home directory
RUN npm install -g bun

# Create the virtual environment
RUN uv venv

# Copy the Python requirements file
COPY --chown=node requirements.txt .
# Install packages into the virtual environment
RUN uv pip install -r requirements.txt

# Copy all other application files
COPY --chown=node . .

# Expose the port (the port number here is for documentation; the one in the CMD matters)
EXPOSE 7860

# --- FIX: Add '--host 0.0.0.0' to the startup command ---
# This tells the server to listen on all network interfaces, not just localhost.
# We also use ${PORT-7860} to dynamically get the port from Hugging Face.
CMD npx -y @srbhptl39/mcp-superassistant-proxy@latest --config config.json --host 0.0.0.0 --port ${PORT-7860} --baseUrl $SPACE_HOST