From 7089549cd04d7ab42e85827fb8ee98af61daec2b Mon Sep 17 00:00:00 2001 From: Henry Mao <1828968+calclavia@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:01:34 +0800 Subject: [PATCH] Add Dockerfile --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5d14a0c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +# 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"]