Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +16 -15
Dockerfile
CHANGED
|
@@ -1,39 +1,40 @@
|
|
| 1 |
-
# Start from a Node.js base image
|
| 2 |
FROM node:20-slim
|
| 3 |
|
| 4 |
# Install system dependencies for Python and uv (curl) as root
|
| 5 |
RUN apt-get update && apt-get install -y python3-pip curl && apt-get clean
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
# The 'node:20-slim' image already includes a non-root user named 'node' with UID 1000.
|
| 9 |
-
# We do NOT need to create a new user. We will use the existing one.
|
| 10 |
-
|
| 11 |
-
# --- FIX: Switch to the existing 'node' user ---
|
| 12 |
USER node
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
# Set the home directory and add the user's local bin to the PATH
|
| 16 |
ENV HOME=/home/node
|
| 17 |
-
|
| 18 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
WORKDIR ${HOME}/app
|
| 20 |
|
| 21 |
-
# Install 'uv', the fast Python package manager
|
| 22 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 23 |
|
| 24 |
-
#
|
|
|
|
| 25 |
RUN npm install -g bun
|
| 26 |
|
| 27 |
-
# --- FIX: Use '--chown=node' ---
|
| 28 |
# Copy the Python requirements file and install dependencies using uv
|
| 29 |
COPY --chown=node requirements.txt .
|
| 30 |
RUN uv pip install -r requirements.txt
|
| 31 |
|
| 32 |
-
# Copy all other application files
|
| 33 |
COPY --chown=node . .
|
| 34 |
|
| 35 |
# Expose the port that the MCP proxy will run on
|
| 36 |
EXPOSE 3006
|
| 37 |
|
| 38 |
-
# The command to start the main MCP proxy server
|
| 39 |
CMD npx -y @srbhptl39/mcp-superassistant-proxy@latest --config config.json --port ${PORT-3006} --baseUrl $SPACE_HOST
|
|
|
|
| 1 |
+
# Start from a Node.js base image
|
| 2 |
FROM node:20-slim
|
| 3 |
|
| 4 |
# Install system dependencies for Python and uv (curl) as root
|
| 5 |
RUN apt-get update && apt-get install -y python3-pip curl && apt-get clean
|
| 6 |
|
| 7 |
+
# The 'node:20-slim' image already includes a non-root user named 'node'. We will use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
USER node
|
| 9 |
|
| 10 |
+
# Set the home directory for clarity
|
|
|
|
| 11 |
ENV HOME=/home/node
|
| 12 |
+
|
| 13 |
+
# --- FIX: Configure npm to use a user-owned directory for global packages ---
|
| 14 |
+
# Set the prefix for global npm installations to a directory within the user's home
|
| 15 |
+
ENV NPM_CONFIG_PREFIX=${HOME}/.npm-global
|
| 16 |
+
# Add the new npm global binary directory to the system's PATH
|
| 17 |
+
ENV PATH=${NPM_CONFIG_PREFIX}/bin:${HOME}/.local/bin:${PATH}
|
| 18 |
+
|
| 19 |
+
# Set the working directory inside the user's home
|
| 20 |
WORKDIR ${HOME}/app
|
| 21 |
|
| 22 |
+
# Install 'uv', the fast Python package manager
|
| 23 |
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 24 |
|
| 25 |
+
# --- FIX: This command will now succeed ---
|
| 26 |
+
# Install 'bun' globally. It will now be installed in /home/node/.npm-global/
|
| 27 |
RUN npm install -g bun
|
| 28 |
|
|
|
|
| 29 |
# Copy the Python requirements file and install dependencies using uv
|
| 30 |
COPY --chown=node requirements.txt .
|
| 31 |
RUN uv pip install -r requirements.txt
|
| 32 |
|
| 33 |
+
# Copy all other application files
|
| 34 |
COPY --chown=node . .
|
| 35 |
|
| 36 |
# Expose the port that the MCP proxy will run on
|
| 37 |
EXPOSE 3006
|
| 38 |
|
| 39 |
+
# The command to start the main MCP proxy server
|
| 40 |
CMD npx -y @srbhptl39/mcp-superassistant-proxy@latest --config config.json --port ${PORT-3006} --baseUrl $SPACE_HOST
|