Skip to content

Commit

Permalink
Dockerize application
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBailey committed Sep 15, 2022
1 parent c69ceea commit 7d3714b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:16
WORKDIR /src
COPY package*.json .
RUN npm install
COPY . .
EXPOSE 2278
CMD ["node","index.js"]
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -66,6 +80,12 @@ forever start index.js
cd DiscordBotPanel && node .
```

#### Docker Compose

```
docker compose up -d
```

### Nginx Config

```nginx
Expand Down

0 comments on commit 7d3714b

Please sign in to comment.