diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5171c54 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..517af58 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:16 +WORKDIR /src +COPY package*.json . +RUN npm install +COPY . . +EXPOSE 2278 +CMD ["node","index.js"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..77ed0cc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: "3" +services: + node: + container_name: discord_bot_dashboard + build: . + ports: + - 8080:2278 + volumes: + - ./bots:/src/bots + - ./database:/src/database + restart: unless-stopped \ No newline at end of file diff --git a/readme.md b/readme.md index e886f3a..6a43764 100644 --- a/readme.md +++ b/readme.md @@ -15,6 +15,8 @@ We host our panel on [DigitalOcean](https://www.digitalocean.com/?refcode=bcc56a ## Installation +### Standard Installation + ```shell ## Install PM2 Globally npm i pm2 -g @@ -33,6 +35,16 @@ npm install mv .env.example .env ``` +### Docker Compose + +```shell +## Clone this repository +git clone https://github.com/jareer12/DiscordBotPanel.git + +## Rename .env - Change everything to your liking except PORT +mv .env.example +``` + ### Demo [https://server.jubot.site/](https://server.jubot.site/create) @@ -54,6 +66,8 @@ By default the login system is disabled but you can enable it by changing `LOGIN Once the installation and configuration is complete we can start our panel and run it. We'll be using `forever` to run the panel, the reason we'll use `forever` is that it can prevent downtime, so in case our panel runs into and error that it can not handle(which it most likely will), `forever` will re-start the panel by itself, preventing downtime. +#### Standard (non-docker) + ```shell ## Open the folder cd DiscordBotPanel @@ -66,6 +80,12 @@ forever start index.js cd DiscordBotPanel && node . ``` +#### Docker Compose + +``` +docker compose up -d +``` + ### Nginx Config ```nginx