Newer
Older
[](https://github.com/Griefed/docker-D-Zone)

Griefed
committed
---
[](https://hub.docker.com/repository/docker/griefed/d-zone)
[](https://hub.docker.com/repository/docker/griefed/d-zone)
[](https://hub.docker.com/repository/docker/griefed/d-zone)
[](https://hub.docker.com/repository/docker/griefed/d-zone)
[](https://github.com/Griefed/docker-D-Zone)
[](https://github.com/Griefed/docker-D-Zone)

Griefed
committed
docker-D-Zone

Griefed
committed
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.
[](https://github.com/d-zone-org/d-zone)

Griefed
committed
Creates a Container which runs [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.

Griefed
committed
The [lsiobase/alpine](https://hub.docker.com/r/lsiobase/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

Griefed
committed
Tags | Description
-----|-------------
port | Use tag `port` if accessing d-zone via IP:PORT
proxy | Use tag `proxy` if accessing d-zone through a reverse proxy line NGINX
port-arm | Use tag `port-arm` if accessing d-zone via IP:PORT
proxy-arm | Use tag `proxy-arm` if accessing d-zone through a reverse proxy line NGINX

Griefed
committed
image: griefed/d-zone

Griefed
committed
- ./path/to/config:/config

Griefed
committed
ports:
- 3000:3000
-

Griefed
committed
## Raspberry Pi
To run this container on a Raspberry Pi, use the `arm`-prefix for the `port`- and `proxy`-tags. I've tested the `port`-tag on a Raspberry Pi 3B.
`griefed/d-zone:port-arm`
`griefed/d-zone:proxy-arm`
Configuration | Explanation
------------ | -------------

Griefed
committed
[Restart policy](https://docs.docker.com/compose/compose-file/#restart) | "no", always, on-failure, unless-stopped
config volume | Contains config files and logs.
data volume | Contains your/the containers important data.
TZ | Timezone
PUID | for UserID
PGID | for GroupID

Griefed
committed
ports | The port where d-zone will be available at. Only relevant when using `griefed/d-zone:port`
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`.
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:
$ id username
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)

Griefed
committed
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",
"default": true,
"ignoreChannels": ["TEXTCHANNEL_ID1","TEXTCHANNEL_ID2","TEXTCHANNEL_ID3"]
}
]
```
If you want to define multiple servers, see https://github.com/d-zone-org/d-zone/blob/master/discord-config-example.json
## Running D-Zone behind a reverse proxy like NGINX
If you want to serve d-zone with a reverse proxy like nginx and HTTPS, then this may be of help to you:
volumes:
- ./path/to/config/files:/config
- TZ=Europe/Berlin
- PUID=1000 #User ID
- PGID=1000 #Group ID
I use a dockerized NGINX as a reverse proxy, specifically [linuxserver/swag](https://hub.docker.com/r/linuxserver/swag).
include /config/nginx/ssl.conf;
client_max_body_size 0;
# enable for ldap auth, fill in ldap details in ldap.conf
#include /config/nginx/ldap.conf;
# enable for Authelia
#include /config/nginx/authelia-server.conf;
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable the next two lines for ldap auth
#auth_request /auth;
#error_page 401 =200 /ldaplogin;
# enable for Authelia
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;

Griefed
committed
proxy_set_header HOST ;
proxy_set_header X-Real-IP ;
proxy_set_header X-Forwarded-For ;
proxy_set_header X-Forwarded-Proto ;

Griefed
committed
set d-zone;
set 3000;
set http;
proxy_pass ://:;

Griefed
committed
### Building the image yourself

Griefed
committed
Use the [Dockerfile](https://github.com/Griefed/docker-D-Zone/Dockerfile) to build the image yourself, in case you want to make any changes to it
#### docker-compose.yml
```docker-compose.yml
version: '3.6'
services:
d-zone:
container_name: d-zone

Griefed
committed
build: ./docker-D-Zone/
restart: unless-stopped
volumes:
- ./path/to/config/files:/config
environment:
- TZ=Europe/Berlin

Griefed
committed
- PUID=1000 # User ID
- PGID=1000 # Group ID

Griefed
committed
- 8080:3000
-

Griefed
committed
1. Clone the repository: `git clone https://github.com/Griefed/docker-D-Zone.git ./docker-D-Zone`
1. Rename **Dockerfile.port** to **Dockerfile**: `mv Dockerfile.port Dockerfile`
1. Prepare docker-compose.yml file as seen above
1. `docker-compose up -d --build d-zone`

Griefed
committed
1. Visit IP.ADDRESS.OF.HOST:8080