-
Notifications
You must be signed in to change notification settings - Fork 2
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 #3
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile | ||
# Use a Node.js image with a specific version that supports TypeScript | ||
FROM node:18-alpine AS builder | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copy package.json and package-lock.json for dependency installation | ||
COPY package.json package-lock.json ./ | ||
|
||
# Install the dependencies | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the TypeScript code | ||
RUN npm run build | ||
|
||
# Use a smaller Node.js image to reduce the size of the final image | ||
FROM node:18-alpine AS release | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# Copy the compiled code from the builder stage | ||
COPY --from=builder /usr/src/app/dist ./dist | ||
COPY package.json ./ | ||
|
||
# Install only production dependencies | ||
RUN npm install --production | ||
|
||
# Specify the command to run the MCP server | ||
ENTRYPOINT ["node", "dist/index.js"] | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,11 @@ | ||||||||||||||||||||||||||||||||||
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
startCommand: | ||||||||||||||||||||||||||||||||||
type: stdio | ||||||||||||||||||||||||||||||||||
configSchema: | ||||||||||||||||||||||||||||||||||
# JSON Schema defining the configuration options for the MCP. | ||||||||||||||||||||||||||||||||||
type: object | ||||||||||||||||||||||||||||||||||
Comment on lines
+5
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance config schema with required properties and validation. The current schema is too basic. Consider adding:
Example schema: configSchema:
type: object
+ required: []
+ properties:
+ port:
+ type: number
+ description: "Port to run the server on"
+ default: 3000
+ logLevel:
+ type: string
+ enum: ["debug", "info", "warn", "error"]
+ default: "info" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
commandFunction: | ||||||||||||||||||||||||||||||||||
# A function that produces the CLI command to start the MCP on stdio. | ||||||||||||||||||||||||||||||||||
|- | ||||||||||||||||||||||||||||||||||
config => ({command: 'node', args: ['dist/index.js']}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add security and best practices to Dockerfile.
Consider the following improvements:
Also create a
.dockerignore
file: