From 64a5c47d3e6bd7f3b2a4de0bdff27f55ba21b278 Mon Sep 17 00:00:00 2001 From: ysdragon Date: Mon, 14 Oct 2024 20:23:47 +0300 Subject: [PATCH] Use `bun` instead of `node` --- Dockerfile | 16 +++++----------- README.md | 2 +- package.json | 8 ++++---- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0a6baf..044c7d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# Use the official nodejs lts alpine image as the base image -FROM node:lts-alpine +# Use the official Bun alpine image as the base image +FROM oven/bun:alpine # Set the working directory WORKDIR /home/bots/StreamBot @@ -7,23 +7,17 @@ WORKDIR /home/bots/StreamBot # Install important deps RUN apk --no-cache add --virtual .builds-deps build-base python3 ffmpeg -# Install pnpm -RUN npm install pnpm -g - # Copy package.json COPY package.json ./ # Install dependencies -RUN pnpm install - -# Install node dev types -RUN pnpm install --save-dev @types/node +RUN bun install # Copy the rest of the application code COPY . . # Build the application -RUN pnpm run build +RUN bun run build # Specify the port number the container should expose EXPOSE 3000 @@ -32,4 +26,4 @@ EXPOSE 3000 RUN mkdir -p ./videos # Command to run the application -CMD ["pnpm", "run", "start"] +CMD ["bun", "run", "start"] diff --git a/README.md b/README.md index fbf895a..f01a1b1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This is a Discord selfbot that allows streaming videos, and streams from YouTube - Get playback status. ## Requirements -[node.js](https://nodejs.org/) _(version 16.9.0 or later)_ +[bun](https://bun.sh/) _(must be added to path or installed to working directory)_ [ffmpeg](https://www.ffmpeg.org/) _(must be added to path or installed to working directory)_ ## 🛠️ Installation Steps: diff --git a/package.json b/package.json index e8c0a2b..4338874 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "A self bot to stream movies/videos to Discord.", "main": "dist/index.js", "scripts": { - "start": "node ./dist/index.js", - "server": "node ./dist/server.js", - "build": "npx tsc", - "watch": "npx tsc -w" + "start": "bun ./dist/index.js", + "server": "bun ./dist/server.js", + "build": "bunx tsc", + "watch": "bunx tsc -w" }, "author": "ysdragon", "license": "MIT",