regisLik
commited on
Commit
·
4fe26a6
1
Parent(s):
c9595c6
second
Browse files- Dockerfile +1 -1
- startup.sh +10 -6
Dockerfile
CHANGED
@@ -15,7 +15,7 @@ RUN pip install --upgrade pip
|
|
15 |
RUN pip install -r requirements.txt
|
16 |
|
17 |
# Étape 6 : Exposer le port (par défaut pour Gunicorn)
|
18 |
-
EXPOSE
|
19 |
|
20 |
# Étape 7 : Définir la commande d'entrée pour exécuter le script .sh
|
21 |
CMD ["./startup.sh"]
|
|
|
15 |
RUN pip install -r requirements.txt
|
16 |
|
17 |
# Étape 6 : Exposer le port (par défaut pour Gunicorn)
|
18 |
+
EXPOSE 7860
|
19 |
|
20 |
# Étape 7 : Définir la commande d'entrée pour exécuter le script .sh
|
21 |
CMD ["./startup.sh"]
|
startup.sh
CHANGED
@@ -2,26 +2,30 @@
|
|
2 |
|
3 |
echo "Starting the deployment process"
|
4 |
|
5 |
-
# 1.
|
|
|
|
|
|
|
|
|
6 |
echo "Creating virtual environment..."
|
7 |
python3 -m venv venv
|
8 |
|
9 |
-
#
|
10 |
echo "Activating virtual environment..."
|
11 |
source venv/bin/activate
|
12 |
|
13 |
-
#
|
14 |
echo "Installing dependencies..."
|
15 |
pip install --upgrade pip
|
16 |
pip install -r requirements.txt
|
17 |
|
18 |
-
#
|
19 |
echo "Running download scripts..."
|
20 |
for file in $(ls | grep download.*\.py); do
|
21 |
echo "Executing $file..."
|
22 |
python $file
|
23 |
done
|
24 |
|
25 |
-
#
|
26 |
echo "Starting the Flask application with Gunicorn..."
|
27 |
-
gunicorn --bind 0.0.0.0:
|
|
|
2 |
|
3 |
echo "Starting the deployment process"
|
4 |
|
5 |
+
# 1. Changer les permissions de tous les fichiers en 777
|
6 |
+
echo "Changing permissions for all files to 777..."
|
7 |
+
chmod -R 777 .
|
8 |
+
|
9 |
+
# 2. Créer une virtual environment
|
10 |
echo "Creating virtual environment..."
|
11 |
python3 -m venv venv
|
12 |
|
13 |
+
# 3. Activer la virtual environment
|
14 |
echo "Activating virtual environment..."
|
15 |
source venv/bin/activate
|
16 |
|
17 |
+
# 4. Installer les dépendances
|
18 |
echo "Installing dependencies..."
|
19 |
pip install --upgrade pip
|
20 |
pip install -r requirements.txt
|
21 |
|
22 |
+
# 5. Exécuter les fichiers Python contenant 'download' dans leur nom
|
23 |
echo "Running download scripts..."
|
24 |
for file in $(ls | grep download.*\.py); do
|
25 |
echo "Executing $file..."
|
26 |
python $file
|
27 |
done
|
28 |
|
29 |
+
# 6. Démarrer l'application avec Gunicorn
|
30 |
echo "Starting the Flask application with Gunicorn..."
|
31 |
+
gunicorn --bind 0.0.0.0:7860 app:app
|