Initial commit projet IoT Flask ESP32

This commit is contained in:
Safouane Bazzi
2026-03-23 17:04:58 +01:00
parent 17026018a9
commit 06597bd9d3
7 changed files with 397 additions and 112 deletions

View File

@@ -1,7 +1,4 @@
version: '3.8'
services:
# 1. LA BASE DE DONNÉES (PostgreSQL)
db:
image: postgres:15-alpine
container_name: ecocharge_db
@@ -10,22 +7,19 @@ services:
POSTGRES_PASSWORD: ecocharge_password
POSTGRES_DB: ecocharge
ports:
- "5432:5432" # <-- Très important : ça te permet de t'y connecter avec DBeaver !
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# La ligne magique : Docker va lire ton database.sql et créer les tables tout seul au premier lancement !
- ./database.sql:/docker-entrypoint-initdb.d/init.sql
# 2. TON SERVEUR WEB (Flask)
web:
build: .
container_name: ecocharge_web
ports:
- "5001:5000" # Ton Dashboard sera sur http://localhost:5000
- "5001:5000"
depends_on:
- db
environment:
# On donne les identifiants au serveur Python pour qu'il trouve la BDD
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=ecocharge