diff --git a/.dockerignore b/.dockerignore index 1d3ed4c..f49e1b8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,3 @@ config.yml +node_modules +package-lock.json diff --git a/.gitignore b/.gitignore index d225ef6..6134a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ package-lock.json .vscode -node_modules \ No newline at end of file +node_modules diff --git a/Dockerfile b/Dockerfile index 7a77bd2..11dce54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -FROM node:22.2.0 +FROM node:20 WORKDIR /app -COPY package.json /app/package.json -# COPY package-lock.json /app/package-lock.json - -RUN npm install - COPY . /app -CMD ["npm", "start"] \ No newline at end of file +# Perform clean install +RUN node index.js + +CMD ["node", "index.js"] diff --git a/README.md b/README.md index 69c72b8..26e966a 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,22 @@ PteroStats is a bot designed to check Pterodactyl Panel and Nodes status and pos Example ## Installation -1. [Getting API key from pterodactyl](#getting-apikey-from-pterodactyl) -2. [Creating Discord Bot](#creating-discord-bot) -3. [Inviting Discord Bot](#inviting-discord-bot) -4. [Getting Channel ID](#getting-channel-id) -5. [Starting bot](#starting-bot) - -- [Using Custom Emoji](#using-custom-emoji) -- [Blacklist Nodes](#blacklist-nodes) +- [Introduction](#introduction) +- [Example](#example) +- [Installation](#installation) + - [Getting API key from pterodactyl](#getting-api-key-from-pterodactyl) + - [Creating Discord Bot](#creating-discord-bot) + - [Inviting Discord Bot](#inviting-discord-bot) + - [Getting Channel ID](#getting-channel-id) + - [Starting bot](#starting-bot) + - [Using Custom Emoji](#using-custom-emoji) + - [Blacklist Nodes](#blacklist-nodes) +- [The node is online but the embed is read as offline](#the-node-is-online-but-the-embed-is-read-as-offline) +- [Docker](#docker) + - [Installation](#installation-1) + - [Docker Compose](#docker-compose) + - [Docker Run](#docker-run) +- [Links](#links) ### Getting API key from pterodactyl @@ -116,6 +124,33 @@ You can add more than one node in the blacklist If you having this issue, you can enable `log_error` on the config file and report it to our discord server at [Support Server](https://discord.gg/zv6maQRah3) +## Docker + +This is a guide to run the bot using docker (alternative way to run the bot) + +### Installation + +```bash +curl -fsSL https://get.docker.com | sh +``` + +### Docker Compose + +Copy the `docker-compose.yml` file to your server and run `docker compose pull` +Copy the `config.yml` file at the same directory as the `docker-compose.yml` file and configure it (refer to the [installation](#installation) section) + +```bash +docker compose up -d +docker compose logs -f pterostats +``` + +### Docker Run + +```bash +docker run -d --name pterostats -v $(pwd)/config.yml:/app/config.yml ghcr.io/hirzidevs/pterostats:latest +docker logs -f pterostats +``` + ## Links - [PteroStats DiscordJS v13](https://github.com/HirziDevs/PteroStats/tree/3d0512c3323ecf079101104c7ecf3c94d265e298) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..99a83ae --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.3' +services: + pterostats: + volumes: + - ./config.yml:/app/config.yml + container_name: pterostats + image: ghcr.io/hirzidevs/pterostats:latest