Update project echo files
This commit is contained in:
37
docker-compose.yml
Normal file
37
docker-compose.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# 1. LA BASE DE DONNÉES (PostgreSQL)
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: ecocharge_db
|
||||
environment:
|
||||
POSTGRES_USER: ecocharge_user
|
||||
POSTGRES_PASSWORD: ecocharge_password
|
||||
POSTGRES_DB: ecocharge
|
||||
ports:
|
||||
- "5432:5432" # <-- Très important : ça te permet de t'y connecter avec DBeaver !
|
||||
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
|
||||
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
|
||||
- DB_USER=ecocharge_user
|
||||
- DB_PASSWORD=ecocharge_password
|
||||
- SECRET_KEY=super_cle_secrete_projet
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user