Creates a Container which runs the heroku branch of [D-Zone-Org's](https://github.com/d-zone-org)[D-Zone](https://github.com/d-zone-org/d-zone), with [node:8-alpine](https://hub.docker.com/_/node) as the base image, as seen on https://pixelatomy.com/dzone/?s=default.
Creates a Container which runs the heroku branch of [D-Zone-Org's](https://github.com/d-zone-org)[D-Zone](https://github.com/d-zone-org/d-zone), with [lsiobase/alpine](https://hub.docker.com/r/lsiobase/alpine) as the base image, as seen on https://pixelatomy.com/dzone/?s=default.
# Deploy with docker-compose:
```
The lasiobase/alpine image is a custom base image built with [Alpine linux](https://alpinelinux.org/) and [S6 overlay](https://github.com/just-containers/s6-overlay).
Using this image allows us to use the same user/group ids in the container as on the host, making file transfers much easier
---
D-Zone is a graphical simulation meant to abstractly represent the activity in your Discord server.
This is not meant for any actual monitoring or diagnostics, only an experiment in the abstraction of chatroom data represented via autonomous characters in a scene.
# Usage
```docker-compose.yml
d-zone:
container_name: d-zone
image: griefed/d-zone
restart: unless-stopped
ports:
- 3000:3000
volumes:
- ./path/to/config/files:/config
environment:
- TOKEN=<YOUR_BOT_TOKEN_HERE>
- TZ=Europe/Berlin
- PUID=1000 #User ID
- PGID=1000 #Group ID
ports:
- 3000:3000
```
### Deploy on Rasbperry Pi
Using the Dockerfile, this container can be built and run on a Raspberry Pi, too! I've tested it on a Raspberry Pi 3B+.
Simply put the Dockerfile in a directory called `d-zone`
```
FROM node:8-alpine
LABEL maintainer="Griefed <griefed@griefed.de>"
LABEL description="Based on https://github.com/d-zone-org/d-zone/tree/v1/docker \
but pulls files from GitHub instead of copying from local filesystem. \
You must set your bot token as an environment variable and your bot must be \
a member of at least one server for this to work."
When using volumes, permissions issues can arise between the host OS and the container. [Linuxserver.io](https://www.linuxserver.io/) avoids this issue by allowing you to specify the user `PUID` and group `PGID`.
WORKDIR /opt/d-zone
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
CMD ["npm","start"]
```
in the same directory as your docker-compose.yml, edit your docker-compose.yml:
Using the [noproxy Dockerfile](https://github.com/Griefed/docker-D-Zone/blob/lsiobase/alpine/Dockerfile.noproxy), this container can be built and run on a Raspberry Pi, too! I've tested it on a Raspberry Pi 3B+.
1. Clone the repository: `git clone https://github.com/Griefed/docker-D-Zone.git ./d-zone`
D-Zone will, by default, listen to all channels on the servers which your bot is connected to. If you want to set ignoreChannels, you need to edit a file in your D-Zone container:
- docker exec into the container: `docker exec -it d-zone /bin/sh`
- Open discord-config.json in NANO: `nano discord-config.json`
- Edit the "servers" block on a per server basis, e.g.:
```
## Specify channels to ignore:
D-Zone will, by default, listen to all channels on the servers which your bot is connected to.
If you want to set ignoreChannels, you need to edit your `discord-config.json`file in the folder you specified in your `volumes:`.
Edit the "servers" block on a per server basis, e.g.:
```json
"servers":[
{
"id":"<YOUR_SERVER_ID_HERE",
...
...
@@ -76,24 +100,26 @@ D-Zone will, by default, listen to all channels on the servers which your bot is
}
]
```
`CTRL+X` followed by `Y` followed by `ENTER` to safe and quit NANO. Enter `exit` to leave the container and restart the container with `docker restart d-zone`.
This tutorial assumes that your bot is only a member of one server. If you want to define multiple server, see https://github.com/d-zone-org/d-zone/blob/master/discord-config-example.json
If you want to define multiple servers, see https://github.com/d-zone-org/d-zone/blob/master/discord-config-example.json
You may also need to exec into the container in order to edit your socket-config.json and change the port D-Zone runs on. The `heroku` branch seems to default to port 0, which, of couse, doesn't work. For the example below to function, you need to change the port to `3000`.
### Note 2
## Running D-Zone behind a reverse proxy like NGINX
I use a dockerized nginx as a reverse proxy, specifically https://hub.docker.com/r/linuxserver/swag.
If you want to serve d-zone with a reverse proxy like nginx and HTTPS, then this may be of help to you: