Managing the Services
Managing the Containers
Once the networks are up, you may:
Stop all datahosting containers with
$ docker compose down
List active containers with
$ docker container ls
Safely start, stop, and restart individual containers with
$ docker container <container name> start
,$ docker container <container name> start
, and$ docker container <container name> restart
, respectively.
Managing web users
Adding or modifying web users
Navigate to the datahosting project root directory.
Stop all datahosting containers with
$ docker compose down
.Open
secrets/web-user-config.json
in a text editor.Edit or add a new user under the “customer“ list element where “slug“ matches the desired customer’s slug field in
daemon/database-config/customer-config.json
.Save and exit
secrets/web-user-config.json
.Restart the containers with
$ docker compose up -d
.
Removing web users
Navigate to the datahosting project root directory.
Stop all datahosting containers with
$ docker compose down
.Open
secrets/web-user-config.json
in a text editor.Remove the desired user under the “customer“ list element where “slug“ matches the desired customer’s slug field in
daemon/database-config/customer-config.json
.Save and exit
secrets/web-user-config.json
.Restart the containers with
$ docker compose up -d
.Access the database with
$ docker exec -it rbr-dhdb-1 mariadb -p datahosting
.Enter the root password.
Enter
> SELECT * FROM user
to view all users.Check that the desired user’s customer ID matches the desired customer with
> SELECT * FROM customer
.Alternatively, filter the customers by entering
> SELECT * FROM customer WHERE customer_id = <customer id>
.
Enter
> DELETE FROM user WHERE (user_id = '<user id>')
to delete the desired user.Enter
CTRL-D
to exit the database interface.
Updating the containers
To update all of the containers:
Navigate to the datahosting project root directory.
Run
$ docker compose pull
to pull the requested image from the registry.Run
$ docker compose up --force-recreate -d
to start the new version.
It is not necessary to update the containers individually.
Using the web host with an NGINX reverse proxy
The reverse proxy should be configured to forward traffic to the open port (80) on the containerized dhdaemon host as defined in docker-compose.yaml
as services > <service> > ports > <host port>:<container port>
.
The nginx instance used to serve the web interface should not be used as a reverse proxy. Another NGINX instance should be used as a reverse proxy.
Example HTTP-only NGINX reverse-proxy configuration
Place the following in the /etc/nginx/sites-available/
directory, change example.com
to your domain name and create a symbolic link to it in the /etc/nginx/sites-enabled/
directory:
Restart the NGINX reverse proxy and try accessing the RBR datahosting web interface.
Example HTTPS NGINX reverse-proxy configuration with SSL termination
ssl.conf
assumes that you have already obtained an SSL certificate and its key and that both are stored in the /etc/ssl/private
directory.
If the reverse proxy NGINX server is not already set up for SSL, place the following in the /etc/nginx/
directory:
Place the following in the /etc/nginx/sites-available/
directory and create symbolic links to them in the /etc/nginx/sites-enabled/
directory:
Lastly, run
openssl dhparam -out dhparams.pem 4096
And restart the NGINX reverse proxy.
Additional resources
These reverse proxy examples were modified from a free tutorial at: https://www.freecodecamp.org/news/docker-nginx-letsencrypt-easy-secure-reverse-proxy-40165ba3aee2/
Find NGINX’s official documentation at: https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
Find NGINX’s official documentation on running NGINX on Docker at: https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-docker/#running-nginx-open-source-in-a-docker-container