37 lines
896 B
Docker
37 lines
896 B
Docker
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
|
|
# Use a Node.js image for the build
|
|
FROM node:20-alpine AS builder
|
|
|
|
# Install yt-dlp
|
|
RUN apk add --no-cache yt-dlp
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
|
|
# Copy necessary files
|
|
COPY package.json tsconfig.json /app/
|
|
COPY src /app/src
|
|
|
|
# Install dependencies
|
|
RUN --mount=type=cache,target=/root/.npm \
|
|
npm install --ignore-scripts
|
|
|
|
# Build the TypeScript files
|
|
RUN npm run prepare
|
|
|
|
# Create a new image for the runtime
|
|
FROM node:20-alpine AS runtime
|
|
|
|
# Copy yt-dlp from the builder
|
|
COPY --from=builder /usr/bin/yt-dlp /usr/bin/yt-dlp
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
|
|
# Copy the built files and node modules from the builder
|
|
COPY --from=builder /app/lib /app/lib
|
|
COPY --from=builder /app/node_modules /app/node_modules
|
|
|
|
# Set the command to run the MCP server
|
|
ENTRYPOINT ["node", "lib/index.mjs"]
|