Spaces:
Sleeping
Sleeping
Commit
·
ff1a300
1
Parent(s):
d2ba52b
Add Dockerfile, FastAPI app, and start script for Vestiq Fashion Analyzer
Browse files- DockerFile → Dockerfile +1 -0
- app.py +23 -0
- docker-compose.yml +3 -5
- start.sh +1 -1
DockerFile → Dockerfile
RENAMED
@@ -21,6 +21,7 @@ RUN pip3 install --no-cache-dir -r requirements.txt
|
|
21 |
|
22 |
# Copy your FastAPI app
|
23 |
COPY fast.py .
|
|
|
24 |
COPY start.sh .
|
25 |
RUN chmod +x start.sh
|
26 |
|
|
|
21 |
|
22 |
# Copy your FastAPI app
|
23 |
COPY fast.py .
|
24 |
+
COPY app.py .
|
25 |
COPY start.sh .
|
26 |
RUN chmod +x start.sh
|
27 |
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
"""
|
3 |
+
Hugging Face Space entry point for Vestiq Fashion Analyzer
|
4 |
+
This file serves as the main entry point for the Hugging Face Space.
|
5 |
+
"""
|
6 |
+
|
7 |
+
import os
|
8 |
+
import sys
|
9 |
+
import uvicorn
|
10 |
+
from fast import app
|
11 |
+
|
12 |
+
# Ensure the app runs on the correct port for Hugging Face Spaces
|
13 |
+
PORT = int(os.environ.get("PORT", 7860))
|
14 |
+
HOST = "0.0.0.0"
|
15 |
+
|
16 |
+
if __name__ == "__main__":
|
17 |
+
print(f"Starting Vestiq Fashion Analyzer on {HOST}:{PORT}")
|
18 |
+
uvicorn.run(
|
19 |
+
app,
|
20 |
+
host=HOST,
|
21 |
+
port=PORT,
|
22 |
+
log_level="info"
|
23 |
+
)
|
docker-compose.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
version:
|
2 |
|
3 |
services:
|
4 |
ollama:
|
@@ -32,8 +32,7 @@ services:
|
|
32 |
environment:
|
33 |
- OLLAMA_BASE_URL=http://ollama:11434
|
34 |
depends_on:
|
35 |
-
ollama
|
36 |
-
condition: service_healthy
|
37 |
networks:
|
38 |
- fashion-analyzer
|
39 |
volumes:
|
@@ -46,8 +45,7 @@ services:
|
|
46 |
environment:
|
47 |
- OLLAMA_HOST=http://ollama:11434
|
48 |
depends_on:
|
49 |
-
ollama
|
50 |
-
condition: service_healthy
|
51 |
networks:
|
52 |
- fashion-analyzer
|
53 |
command: >
|
|
|
1 |
+
version: "3.8"
|
2 |
|
3 |
services:
|
4 |
ollama:
|
|
|
32 |
environment:
|
33 |
- OLLAMA_BASE_URL=http://ollama:11434
|
34 |
depends_on:
|
35 |
+
- ollama
|
|
|
36 |
networks:
|
37 |
- fashion-analyzer
|
38 |
volumes:
|
|
|
45 |
environment:
|
46 |
- OLLAMA_HOST=http://ollama:11434
|
47 |
depends_on:
|
48 |
+
- ollama
|
|
|
49 |
networks:
|
50 |
- fashion-analyzer
|
51 |
command: >
|
start.sh
CHANGED
@@ -20,4 +20,4 @@ echo "Model pulled successfully!"
|
|
20 |
# Start FastAPI on port 7860 (HF Spaces requirement)
|
21 |
echo "Starting FastAPI server on port 7860..."
|
22 |
cd /app
|
23 |
-
python3
|
|
|
20 |
# Start FastAPI on port 7860 (HF Spaces requirement)
|
21 |
echo "Starting FastAPI server on port 7860..."
|
22 |
cd /app
|
23 |
+
python3 app.py
|