For NVIDIA
If you want to install the API inside a docker container, you'll need to bind your GPU to the container. So for this, nvidia must be fonctionnal at first, and then you need to install an additional package for docker nvidia-container-toolkit
.
To check if nvidia is correctly installed and also grab the exact driver version, type the below command
$ nvidia-smi
# Output should look like this
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 |
|-----------------------------------------+----------------------+----------------------+
So the exact version I have is CUDA Version: 12.1
, this is the image you need to set in the API Dockerfile
For example in this case, according to the available tags for Cuda container
FROM nvidia/cuda:11.2.0-devel-ubuntu20.04
It is important to take the devel
build on top of ubuntu
. Otherwise you can get issues with the installation of dependencies.
The below plugin is needed to bind you GPU to the docker container which can then be used by Hashcat.
sudo apt install nvidia-container-toolkit
Based on the version you want to deploy, production or developpement, both of the compose are present.
The installation process is in 2 steps:
- Build and start the docker-compose
- Add the traefik endpoint to the
/etc/hosts
file
The docker composes are all-in-one configurations. It mount all the services inside the same network. But if you want to split your API and frontend to different endpoints, make sure to change the frontend environnement variables and also the docker compose environnement variables.
Traefik configuration is also provided to make it easier to deploy. Refer to the documentation for more configurations.
To start the docker compose, jump into the wanted directory and run
docker-compose -p hashkitty up -d
If you want to contribute or simply want to try in test mode first, this docker compose mount the code as volumes inside the containers.
For the frontend developpement, it will automatically recompile the code, so you won't need to restart the container. But for the API, it is necessary to do so.
This is why i do not recommand to use the API inside a docker container for developpement. The best solution is to run the API on you localhost and configure the frontend to connect to it.
Traefik configuration is also provided to make it easier to deploy. Refer to the documentation for more configurations.
To start the docker compose, jump into the wanted directory and run
docker-compose -p hashkitty up -d
If you did not change the default endpoints and ips, the line you need to add to your hosts file should look like this. The IP correspond to the traefik container.
# Add this inside your /etc/hosts file.
172.123.0.2 traefik.lan api.hashkitty.lan hashkitty.lan
If you have any problems with MySql that does not start, please reach the path ./hashkitty-server/sqldump
and then change the permissions of the folder.
It is because the file is mounted inside the container and cannot be read by the database
chmod 777 ./hashkitty-server/sqldump