First Commit with Docker
This commit is contained in:
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.buildpath
|
||||||
|
.DS_Store
|
||||||
|
.git
|
||||||
|
.htaccess
|
||||||
|
.idea
|
||||||
|
.log
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Utiliser une image Python
|
||||||
|
FROM python:3.10
|
||||||
|
|
||||||
|
# Créer un répertoire de travail
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Copier les fichiers nécessaires dans le conteneur
|
||||||
|
COPY requirements.txt /src/requirements.txt
|
||||||
|
|
||||||
|
# Installer les dépendances
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copier le reste du code de l'application dans le conteneur
|
||||||
|
COPY . /src
|
||||||
|
|
||||||
|
# Exposer le port 5000 pour accéder à l'application Flask
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
# Lancer un script pour démarrer MySQL en arrière-plan puis l'application Python
|
||||||
|
CMD service mysql start && python3 app.py
|
||||||
|
|
||||||
14
README.txt
Normal file
14
README.txt
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Construction
|
||||||
|
|
||||||
|
docker build -t flask-web-app .
|
||||||
|
|
||||||
|
# Lancement
|
||||||
|
|
||||||
|
docker run -it -p 5000:5000 -v $(pwd)/src/:/src flask-web-app bash
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
8
requirements.txt
Normal file
8
requirements.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
numpy==1.26.4
|
||||||
|
pandas==2.2.3
|
||||||
|
bottleneck==1.4.2
|
||||||
|
numexpr==2.10.2
|
||||||
|
pandas-ta==0.3.14b
|
||||||
|
matplotlib
|
||||||
|
Flask==2.2.3
|
||||||
|
Werkzeug==2.2.3
|
||||||
16
src/app.py
Normal file
16
src/app.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# app.py
|
||||||
|
from flask import Flask, render_template, request
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def home():
|
||||||
|
return render_template('index.html') # Page d'accueil avec un formulaire ou autre contenu
|
||||||
|
|
||||||
|
@app.route('/process', methods=['POST'])
|
||||||
|
def process():
|
||||||
|
# Traitez ici les données envoyées par l'utilisateur
|
||||||
|
return "Données traitées !"
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True, host='0.0.0.0', port=5000)
|
||||||
16
src/main.py
Normal file
16
src/main.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# app.py
|
||||||
|
from flask import Flask, render_template, request
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def home():
|
||||||
|
return render_template('index.html') # Page d'accueil avec un formulaire ou autre contenu
|
||||||
|
|
||||||
|
@app.route('/process', methods=['POST'])
|
||||||
|
def process():
|
||||||
|
# Traitez ici les données envoyées par l'utilisateur
|
||||||
|
return "Données traitées !"
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True, host='0.0.0.0', port=5000)
|
||||||
48
src/templates/index.html
Normal file
48
src/templates/index.html
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<!-- templates/index.html -->
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Statistiques Freqtrade</title>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.3.2/dist/echarts.min.js"></script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Bienvenue dans l'interface web !</h1>
|
||||||
|
<form action="/process" method="post">
|
||||||
|
<input type="text" name="data" placeholder="Entrez des données">
|
||||||
|
<button type="submit">Envoyer</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- Div où le graphique sera affiché -->
|
||||||
|
<div id="chart" style="width: 600px; height: 400px;"></div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Initialiser l'instance de graphique
|
||||||
|
var chart = echarts.init(document.getElementById('chart'));
|
||||||
|
|
||||||
|
// Définir les options du graphique
|
||||||
|
var option = {
|
||||||
|
title: {
|
||||||
|
text: 'Exemple de Graphique Linéaire'
|
||||||
|
},
|
||||||
|
tooltip: {},
|
||||||
|
legend: {
|
||||||
|
data: ['Ventes']
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
data: ['Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim']
|
||||||
|
},
|
||||||
|
yAxis: {},
|
||||||
|
series: [{
|
||||||
|
name: 'Ventes',
|
||||||
|
type: 'line',
|
||||||
|
data: [5, 20, 36, 10, 10, 20, 30]
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
// Utiliser les options pour afficher le graphique
|
||||||
|
chart.setOption(option);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
22
src/templates/js/echarts.js
Normal file
22
src/templates/js/echarts.js
Normal file
File diff suppressed because one or more lines are too long
22
src/templates/js/echarts_simple.js
Normal file
22
src/templates/js/echarts_simple.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user