Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment: Dockerfile and Smithery config #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Use an official Node.js image as a parent image
FROM node:18-alpine AS builder

# Set the working directory in the container to /app
WORKDIR /app

# Copy package.json and package-lock.json into the container at /app
COPY package.json package-lock.json ./

# Install project dependencies
RUN npm install

# Copy the rest of the project's files into the container at /app
COPY . .

# Build the TypeScript project
RUN npm run build

# Production image
FROM node:18-alpine

# Set the working directory to /app
WORKDIR /app

# Copy the build output and node_modules from the builder stage to the production image
COPY --from=builder /app/build /app/build
COPY --from=builder /app/node_modules /app/node_modules

# Set environment variables
ENV STABILITY_AI_API_KEY=your_api_key_here
ENV IMAGE_STORAGE_DIRECTORY=/tmp/stability-ai-images

# Create the image storage directory
RUN mkdir -p /tmp/stability-ai-images

# Expose port (if the application listens on a port)
# EXPOSE 3000

# Run the application
ENTRYPOINT ["node", "build/index.js"]
21 changes: 21 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Smithery configuration file: https://smithery.ai/docs/deployments

startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- stabilityAiApiKey
properties:
stabilityAiApiKey:
type: string
description: Your Stability AI API key.
imageStorageDirectory:
type: string
default: /tmp/stability-ai-images
description: Directory where generated images will be saved.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
config => ({ command: 'node', args: ['build/index.js'], env: { STABILITY_AI_API_KEY: config.stabilityAiApiKey, IMAGE_STORAGE_DIRECTORY: config.imageStorageDirectory || '/tmp/stability-ai-images' } })