From 95ea55d97288049c47569b32ea758d556ca5b561 Mon Sep 17 00:00:00 2001 From: aki Date: Wed, 23 Apr 2025 23:27:29 +0800 Subject: [PATCH] chore(docker): switch to pnpm, update Dockerfile, docker-compose, and README --- Dockerfile | 14 +++----------- README.md | 6 +++--- docker-compose.yml | 8 +++----- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9102054..bafe1f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,15 @@ -# Use official Node.js LTS image FROM node:18-alpine -# Create app directory WORKDIR /app -# Install build dependencies and copy manifest -RUN apk add --no-cache python3 make g++ +RUN apk add --no-cache python3 make g++ pnpm COPY package.json pnpm-lock.yaml ./ -# Install dependencies -RUN npm ci +RUN pnpm install --frozen-lockfile -# Copy source code COPY . . -# Expose no ports (Discord bot) -# Define default environment variables (optional) ENV NODE_ENV=production -# Start the bot -CMD ["node", "src/index.js"] +CMD [node, src/index.js] diff --git a/README.md b/README.md index 677e20a..f8919de 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,15 @@ Discord music bot template written in NodeJS using `discord.js` and `erela.js`, ``` 3. Run tests: ```sh - npm test + pnpm test ``` 4. Register slash commands: ```sh - npm start # or node deploy-commands.js + pnpm start # or node deploy-commands.js ``` 5. Start the bot: ```sh - npm start + pnpm start ``` ## Docker diff --git a/docker-compose.yml b/docker-compose.yml index 0f99b26..1c174f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,13 @@ -version: '3.8' - services: lavalink: - image: jagrosh/lavalink:latest + image: fredboat/lavalink:latest container_name: lavalink ports: - "2333:2333" environment: - LAVALINK_PASSWORD=${LAVALINK_PASSWORD} volumes: - # Optional: mount custom configuration if needed - # - ./application.yml:/opt/Lavalink/application.yml + - ./application.yml:/opt/Lavalink/application.yml:ro,Z bot: build: . @@ -20,5 +17,6 @@ services: environment: - LAVALINK_HOST=lavalink - LAVALINK_PORT=2333 + - LAVALINK_PASSWORD=${LAVALINK_PASSWORD} depends_on: - lavalink