Skip to content

Commit

Permalink
Update docker_options.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham authored Nov 18, 2024
1 parent 611ff34 commit d18fbb9
Showing 1 changed file with 49 additions and 39 deletions.
88 changes: 49 additions & 39 deletions docker_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,55 +75,55 @@ docker compose down
### Architecture

```mermaid
graph TD
subgraph DockerNetwork ["Docker Network: mobsf_network"]
graph TB
%% Define the Docker Network
subgraph DockerNetwork ["Docker Network"]
direction LR
postgres[(Postgres DB)]
nginx[/Nginx\]
mobsf{{MobSF}}
nginx[/Nginx Server/]
mobsf{{MobSF Framework}}
djangoq[/DjangoQ Worker/]
end
host[/Host Machine\]
%% Define the Host Machine
host[/Host Machine/]
host --> |"Volume:<br/>$HOME/MobSF/<br/>postgresql_data"| postgres
host --> |"Volume:<br/>./nginx.conf"| nginx
host --> |"Volume:<br/>$HOME/MobSF/<br/>mobsf_data"| mobsf
%% Host Volume Mappings
host --> |"Volume:<br/>$HOME/MobSF/postgresql_data<br/>to<br/>/var/lib/postgresql/data"| postgres
host --> |"Volume:<br/>./nginx.conf<br/>to<br/>/etc/nginx/nginx.conf:ro"| nginx
host --> |"Volume:<br/>$HOME/MobSF/mobsf_data<br/>to<br/>/home/mobsf/.MobSF"| mobsf
host --> |"Volume:<br/>$HOME/MobSF/mobsf_data<br/>to<br/>/home/mobsf/.MobSF"| djangoq
%% Dependencies
nginx -.- |"Depends on"| mobsf
mobsf -.- |"Depends on"| postgres
mobsf -.- |"Depends on"| djangoq
djangoq -.- |"Depends on"| postgres
nginx === |"Port: 80:4000<br/>Port: 1337:4001"| host
mobsf -.- |"Extra host:<br/>host.docker.internal"| host
%% Add invisible nodes for spacing
inv1((( )))
inv2((( )))
inv3((( )))
inv4((( )))
%% Ports and Connections
nginx === |"Exposes Ports:<br/>80:4000<br/>1337:4001"| host
mobsf -.- |"Extra Host:<br/>host.docker.internal"| host
%% Position invisible nodes
host --- inv1
inv2 --- DockerNetwork
DockerNetwork --- inv3
inv4 --- host
%% Styling Definitions
classDef container fill:#e0f7fa,stroke:#006064,stroke-width:2px,rx:5,ry:5;
classDef network fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px,rx:10,ry:10;
classDef host fill:#fff3e0,stroke:#e65100,stroke-width:2px,rx:10,ry:10;
classDef dashed stroke-dasharray: 5 5;
classDef container fill:#e0f7fa,stroke:#006064,stroke-width:2px;
class postgres,nginx,mobsf container;
classDef network fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px,rx:5,ry:5;
%% Assign Styles
class postgres,nginx,mobsf,djangoq container;
class DockerNetwork network;
classDef host fill:#fff3e0,stroke:#e65100,stroke-width:2px;
class host host;
classDef invisible fill:none,stroke:none;
class inv1,inv2,inv3,inv4 invisible;
linkStyle 0,1,2 stroke:#1565c0,stroke-width:2px;
linkStyle 3,4 stroke:#7b1fa2,stroke-width:2px,stroke-dasharray: 5 5;
%% Link Styles
linkStyle 0 stroke:#1565c0,stroke-width:2px;
linkStyle 1 stroke:#1565c0,stroke-width:2px;
linkStyle 2 stroke:#1565c0,stroke-width:2px;
linkStyle 3 stroke:#1565c0,stroke-width:2px;
linkStyle 4 stroke:#7b1fa2,stroke-width:2px,stroke-dasharray: 5 5;
linkStyle 5 stroke:#c62828,stroke-width:3px;
linkStyle 6 stroke:#2e7d32,stroke-width:2px,stroke-dasharray: 5 5;
```

**Docker Compose Configuration for MobSF**
Expand All @@ -133,15 +133,15 @@ This configuration sets up a multi-container environment for running MobSF with
Services:

1. postgres
- Image: PostgreSQL 13
- Image: PostgreSQL 13 image
- Purpose: Provides the database backend for MobSF
- Configuration:
* Persistent volume for data storage
* Environment variables for database credentials
* Connected to mobsf_network

2. nginx
- Image: Latest Nginx
- Image: Latest Nginx image
- Purpose: Acts as a reverse proxy and web server
- Configuration:
* Exposes ports 80 and 1337
Expand All @@ -150,16 +150,26 @@ Services:
* Connected to mobsf_network

3. mobsf
- Image: Latest MobSF
- Image: Latest MobSF image
- Purpose: Runs the Mobile Security Framework application
- Configuration:
* Volume mounted for data persistence
* Volume mounted for MobSF data persistence at /home/mobsf/.MobSF
* Environment variables for PostgreSQL connection
* Depends on postgres service
* Extra host configuration for Docker host access required for adb connectivity
* Connected to mobsf_network

4. djangoq
- Image: Latest MobSF image
- Purpose: Runs DjangoQ2 to manage asynchronous task queues for MobSF
- Configuration:
* Command: Runs qcluster.sh to start DjangoQ2 clusters
* Volume mounted for MobSF data persistence at /home/mobsf/.MobSF
* Environment variables for PostgreSQL connection
* Depends on the postgres service.
* Connected to mobsf_network.

Network:
- A custom bridge network 'mobsf_network' is created for inter-service communication

Note: All services are configured to restart automatically in case of failures.
Note: All services are set to restart automatically in case of failures, except DjangoQ, which is configured to restart unless stopped.

0 comments on commit d18fbb9

Please sign in to comment.