You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. Copy `.env.dist` to `.env` and configure your environment variables:
46
+
```env
47
+
PORT=8000
48
+
MODEL_PATH=train/model.pkl
49
+
```
50
+
51
+
5. Train the model:
11
52
```bash
12
53
cd train/
13
54
python train_model.py
14
-
15
55
cd ..
16
-
uvicorn app.main:app --reload
56
+
```
57
+
58
+
6. Start the server:
59
+
```bash
60
+
uvicorn app.main:app --reload --port $PORT
17
61
```
18
62
19
63
## 🐟 Docker
20
64
65
+
1. Build the Docker image:
21
66
```bash
22
67
docker build -t ml-api .
23
-
docker run -p 8000:8000 ml-api
68
+
```
69
+
70
+
2. Run the container:
71
+
```bash
72
+
docker run --env-file .env -p 8000:8000 ml-api
24
73
```
25
74
26
75
Visit `http://127.0.0.1:8000/docs` for Swagger UI.
@@ -33,3 +82,7 @@ Visit `http://127.0.0.1:8000/docs` for Swagger UI.
33
82
Made with ❤️ by **[Pierre-Henry Soria](https://pierrehenry.be)**. A super passionate & enthusiastic Problem-Solver / Senior Software Engineer. Also a true cheese 🧀, ristretto ☕️, and dark chocolate lover! 😋
34
83
35
84
[](https://x.com/phenrysay"Follow Me on X")[](https://github.com/pH-7"My GitHub")[](https://youtu.be/cWBuZ4DXGK4"YouTube SucceedAI Video")[](https://bsky.app/profile/ph7s.bsky.social"Follow Me on BlueSky")
85
+
86
+
## 📄 License
87
+
88
+
Distributed under the [MIT License](LICENSE.md) 🎉 Happy hacking! 🤠
0 commit comments