AichaFaHugFace commited on
Commit
03bc8ab
·
verified ·
1 Parent(s): 32127a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -32
Dockerfile CHANGED
@@ -1,37 +1,12 @@
1
- name: Deploy API to Hugging Face Spaces
2
 
3
- on:
4
- push:
5
- branches: [ "main" ]
6
- paths:
7
- - '5-Deploiement/getaround_project/api/**'
8
 
9
- jobs:
10
- deploy:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v4
15
 
16
- - name: Push to Hugging Face
17
- env:
18
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
19
- run: |
20
- git config --global user.email "204518881+AichaFa@users.noreply.github.com"
21
- git config --global user.name "AichaFa"
22
-
23
- # Clonage dans un dossier temporaire dédié
24
- git clone https://AichaFa:$HF_TOKEN@huggingface.co/spaces/AichaFaHugFace/getaround-api hf_space
25
-
26
- # Nettoyage et copie propre
27
- find hf_space -maxdepth 1 -not -name 'hf_space' -not -name '.git' -exec rm -rf {} \;
28
- cp -r 5-Deploiement/getaround_project/api/* hf_space/
29
-
30
- # Push classique sur l'historique linéaire
31
- cd hf_space
32
- git add .
33
- git diff-index --quiet HEAD || git commit -m "Deploy: Synchronisation automatique de l'API"
34
- git push origin main
35
- # Force build v5
36
 
37
 
 
1
+ FROM python:3.10-slim
2
 
3
+ WORKDIR /app
 
 
 
 
4
 
5
+ COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
7
 
8
+ COPY . .
9
+
10
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12