# Instalação Shinobi Docker

Link: [https://gitlab.com/Shinobi-Systems/ShinobiDocker](https://gitlab.com/Shinobi-Systems/ShinobiDocker) git clone [https://gitlab.com/Shinobi-Systems/ShinobiDocker.git](https://gitlab.com/Shinobi-Systems/ShinobiDocker.git)

### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#install-shinobi-with-docker)Install Shinobi with Docker

#### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#2024-05-07)2024-05-07

[https://shinobi.video](https://shinobi.video/) [https://docs.shinobi.video/installation/docker](https://docs.shinobi.video/installation/docker)

### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#quick-install)Quick Install

1. Run this in terminal.  
    bash &lt;(curl -s [https://gitlab.com/Shinobi-Systems/Shinobi-Installer/raw/master/shinobi-docker.sh)](https://gitlab.com/Shinobi-Systems/Shinobi-Installer/raw/master/shinobi-docker.sh))

#### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#advanced-install)Advanced Install

1. Download this repository and enter it. 
    - If you **do not have Docker** installed run `sh INSTALL/docker.sh`.
2. Review and modify the `docker-compose.yml` file. 
    - Leave it as-is for default setup.
3. Run the preparation and starter script.  
    bash setup\_and\_run.sh

### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#once-installed)Once Installed

You will be asked if you want to use the included database, default is Yes. Once complete open port 8080 of your Docker host in a web browser.

> The following tables offer a breakdown of the configurations that control how the `shinobi` and `shinobi-sql` services are set up and interact within your Docker environment. Adjustments can be made to these values directly in the associated `docker-compose` files to modify the behavior of the deployment as needed.

#### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#docker-compose-sqlyml--shinobi-sql-service-environment-variables)`docker-compose-sql.yml` : `shinobi-sql`   
Service Environment Variables

<table data-sourcepos="32:1-37:98" dir="auto" id="bkmrk-variable-description"><thead><tr data-sourcepos="32:1-32:98"><th data-sourcepos="32:2-32:23">Variable</th><th data-sourcepos="32:25-32:78">Description</th><th data-sourcepos="32:80-32:97">Default Value</th></tr></thead><tbody><tr data-sourcepos="34:1-34:98"><td data-sourcepos="34:2-34:23">MYSQL\_ROOT\_PASSWORD</td><td data-sourcepos="34:25-34:78">The password for the MySQL root user.</td><td data-sourcepos="34:80-34:97">`rootpassword`</td></tr><tr data-sourcepos="35:1-35:98"><td data-sourcepos="35:2-35:23">MYSQL\_DATABASE</td><td data-sourcepos="35:25-35:78">The name of the database to create.</td><td data-sourcepos="35:80-35:97">`ccio`</td></tr><tr data-sourcepos="36:1-36:98"><td data-sourcepos="36:2-36:23">MYSQL\_USER</td><td data-sourcepos="36:25-36:78">The username for the database.</td><td data-sourcepos="36:80-36:97">`majesticflame`</td></tr><tr data-sourcepos="37:1-37:98"><td data-sourcepos="37:2-37:23">MYSQL\_PASSWORD</td><td data-sourcepos="37:25-37:78">The password for the database user.</td><td data-sourcepos="37:80-37:97">`1234`</td></tr></tbody></table>

#### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#docker-compose-mainyml--shinobi-service-build-arguments-and-environment-variables)  
`docker-compose-main.yml` : `shinobi`   
Service Build Arguments and Environment Variables

#### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#build-arguments)Build Arguments

<table data-sourcepos="43:1-45:115" dir="auto" id="bkmrk-argument-description"><thead><tr data-sourcepos="43:1-43:97"><th data-sourcepos="43:2-43:20">Argument</th><th data-sourcepos="43:22-43:80">Description</th><th data-sourcepos="43:82-43:96">Default Value</th></tr></thead><tbody><tr data-sourcepos="45:1-45:115"><td data-sourcepos="45:2-45:20">SHINOBI\_BRANCH</td><td data-sourcepos="45:22-45:98">The branch of the Shinobi git repository to clone during the build process.</td><td data-sourcepos="45:100-45:114">`dev`</td></tr></tbody></table>

#### [](https://gitlab.com/Shinobi-Systems/ShinobiDocker#environment-variables)Environment Variables

<table data-sourcepos="49:1-56:98" dir="auto" id="bkmrk-variable-description-1"><thead><tr data-sourcepos="49:1-49:92"><th data-sourcepos="49:2-49:20">Variable</th><th data-sourcepos="49:22-49:75">Description</th><th data-sourcepos="49:77-49:91">Default Value</th></tr></thead><tbody><tr data-sourcepos="51:1-51:94"><td data-sourcepos="51:2-51:20">HOME</td><td data-sourcepos="51:22-51:75">The home directory path within the container.</td><td data-sourcepos="51:77-51:93">`/home/Shinobi`</td></tr><tr data-sourcepos="52:1-52:94"><td data-sourcepos="52:2-52:20">DB\_HOST</td><td data-sourcepos="52:22-52:75">Hostname of the MySQL database server.</td><td data-sourcepos="52:77-52:93">`shinobi-sql`</td></tr><tr data-sourcepos="53:1-53:94"><td data-sourcepos="53:2-53:20">DB\_USER</td><td data-sourcepos="53:22-53:75">Username to connect to the MySQL database.</td><td data-sourcepos="53:77-53:93">`majesticflame`</td></tr><tr data-sourcepos="54:1-54:94"><td data-sourcepos="54:2-54:20">DB\_PASSWORD</td><td data-sourcepos="54:22-54:75">Password to connect to the MySQL database.</td><td data-sourcepos="54:77-54:93">`1234`</td></tr><tr data-sourcepos="55:1-55:94"><td data-sourcepos="55:2-55:20">DB\_DATABASE</td><td data-sourcepos="55:22-55:75">Name of the MySQL database to use.</td><td data-sourcepos="55:77-55:93">`ccio`</td></tr><tr data-sourcepos="56:1-56:98"><td data-sourcepos="56:2-56:20">SHINOBI\_UPDATE</td><td data-sourcepos="56:22-56:82">Whether to pull updates from git when the container starts.</td><td data-sourcepos="56:84-56:97">`false`</td></tr></tbody></table>

 **Script Failing? Run this.**

**`apt install dos2unix -y && dos2unix entrypoint.sh && chmod +x entrypoint.sh && dos2unix setup_and_run.sh && chmod +x setup_and_run.sh && bash setup_and_run.sh`**