Skip to content

Commit

Permalink
Use bun instead of node
Browse files Browse the repository at this point in the history
  • Loading branch information
ysdragon committed Oct 14, 2024
1 parent 91d0f58 commit b3f34ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
# 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

# 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
Expand All @@ -32,4 +26,4 @@ EXPOSE 3000
RUN mkdir -p ./videos

# Command to run the application
CMD ["pnpm", "run", "start"]
CMD ["bun", "run", "start"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
[ffmpeg](https://www.ffmpeg.org/) _(must be added to path or installed to working directory)_

## 🛠️ Installation Steps:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit b3f34ca

Please sign in to comment.