56 lines
4.0 KiB
Markdown
56 lines
4.0 KiB
Markdown
# Déploiement Docker - SmartBuilding Dashboard
|
|
|
|
## Conditions for deploying and launching
|
|
- **Operating System Required**: Linux (Ubuntu, Debian, etc.)
|
|
- **Software Required**:
|
|
- `docker` (Engine) installed and natively configured.
|
|
- `docker-compose` plugin.
|
|
- A functional terminal to organically execute `.sh` bash scripts.
|
|
|
|
## A description of what your application does
|
|
The Smart Building Application operates as a robust interconnected dashboard allowing building administrators and visitors to interact dynamically with complex connected objects (thermostats, doors, cameras). Users safely register, authenticate, and modify infrastructural dependencies, which are mapped intelligently through an Express/Node.js backend cleanly serving relational objects out of a MySQL database.
|
|
|
|
## Virtual networks and named volumes
|
|
- **Virtual Network (`app-network`)**: An isolated Docker bridge network exclusively created to shield communication. The 3 containers physically speak to each other internally perfectly bypassing physical host IP mappings (e.g., `phpmyadmin` connects exclusively to `db`).
|
|
- **Named Volume (`mysql-data`)**: A robust Docker persistent volume managed securely by the Docker Engine. The state, rows, and account data live completely disconnected from the ephemeral containers so no logical data is ever lost natively simply upon restart.
|
|
|
|
## Description of the container configuration
|
|
Each service natively defines `restart: unless-stopped` protecting workloads dynamically upon unexpected failure logic.
|
|
Environment variables (e.g. `MYSQL_ROOT_PASSWORD`, `DB_HOST`) securely inject necessary parameters exclusively into instances without hard-coding dangerous strings inside production `.js` controllers. The `db` server mounts `./webapp/user.sql` functionally as read-only simply injecting the required initialized architectures smoothly into the engine explicitly via `utf8mb4`.
|
|
|
|
## List of actual containers
|
|
1. **`db` (mysql:8.0)**: The official relational internal Database engine dynamically handling SQL protocols securely persisting physical data completely on the `mysql-data` internal volume.
|
|
2. **`phpmyadmin` (phpmyadmin/phpmyadmin)**: A powerful Web Interface natively providing root visualization parameters for intelligently diagnosing the `db` cluster dynamically via standard Graphic Interface.
|
|
3. **`webapp` (web-app:1.0)**: The core internal logic component. An official `node:18-alpine` environment natively housing our specific Javascript logic, `express` controllers, and EJS dynamically-rendered HTML templates.
|
|
|
|
## Instructions on how to prepare, run, pause, and delete
|
|
1. **Prepare**: Simply allocates volumes and uniquely builds your structural dependencies.
|
|
```bash
|
|
./prepare-app.sh
|
|
```
|
|
2. **Run**: Creates and logically orchestrates all servers globally in the background securely mapping all logical ports dynamically.
|
|
```bash
|
|
./start-app.sh
|
|
```
|
|
3. **Stop (Pause)**: Freezes all workloads gently, effectively retaining physical configurations locally strictly disconnected.
|
|
```bash
|
|
./stop-app.sh
|
|
```
|
|
4. **Remove (Delete)**: Aggressively destroys containers natively wiping volumes logically alongside custom networks safely explicitly.
|
|
```bash
|
|
./remove-app.sh
|
|
```
|
|
|
|
## Instructions on how to view the application natively
|
|
After actively invoking `./start-app.sh`, securely visit dynamically:
|
|
- **Web Application Dashboard**: [http://localhost:3000](http://localhost:3000)
|
|
- **Database Administrator (phpMyAdmin)**: [http://localhost:8080](http://localhost:8080)
|
|
|
|
## Used Resources
|
|
- Initial Node.js application `projetWEB` codebase (Assignment Baseline).
|
|
- Docker Hub Registry natively referencing Official Images (`mysql:8.0`, `node:18-alpine`, `phpmyadmin/phpmyadmin`).
|
|
- Official `docker-compose` documentation.
|
|
|
|
## How Artificial Intelligence was natively used
|
|
In this project ai was used to help create the .yalm file and understand his importance. It was also used to help Write the README.me file add state clearly what does this application do, list all the dependencies and write it smoothly.
|