Docker DEN

Serves Web Pages

Reply to Humans on Discord

All inside Single Docker Image

It’s so simple we can almost oneLine a deploy to the cloud after clone:

Installing

We’re going to clone and run the docker application locally.

Let’s clone the Repo to get started.

You will need to create file inside app folder: auth.json Here you will Store your App Secrets.

{

"token": "Your Discord Bot Token"

}

BUILD STEPS:

We can try to build the image to verify it can run locally. This command only build the image. Before deploying to Cloud Provider you will have to run this step, so you can check your image runs correctly locally after you local development changes.

docker build ./ Docker-Discord-Express-NodeJS -t docker-den-bot -t Specifies TAG for release you can version by adding : docker-den-bot:v1

Now verify your image has been created.

docker images

You should see your image with a recent timestamp.

REPOSITORY TAG IMAGE ID CREATED SIZE

docker-den-bot latest 593ba8e97fad 11 seconds ago 98.9MB

Now that we have the image let’s run it locally to verify.

docker run -d -p 8080:80 docker-den-bot

Development

To simplify development CD into app Directory and run nodemon to Live reload during Dev

cd docker-den-bot/app/ nodemon index.js

Deployment

I choose Digital Ocean but you can use any provider that support Containers.

Create a Droplet

SSH into Droplet

Edit UFW rules for ports you want to expose

Follow same Build Steps Above

docker run -d -p 8080:80 docker-den-bot:v1

Now visit you IP at port 8080 to view your live site and talk to you Discord BOT.

Now Log into Discord and Chat with your Bot by triggering with bold world below.