sahilmayekar commited on
Commit
16eff4c
·
1 Parent(s): 260efd5

Initial Commit

Browse files
Files changed (3) hide show
  1. Dockerfile +2 -1
  2. entrypoint.sh +1 -1
  3. src/app.py +7 -3
Dockerfile CHANGED
@@ -37,8 +37,9 @@ RUN chmod -R 777 /app/.streamlit /app/.ollama
37
  USER ollama
38
 
39
  ENV OLLAMA_HOST=0.0.0.0:11434
 
40
 
41
- EXPOSE 11434 5000
42
 
43
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
44
 
 
37
  USER ollama
38
 
39
  ENV OLLAMA_HOST=0.0.0.0:11434
40
+ ENV PORT=7860
41
 
42
+ EXPOSE 11434 7860 5000
43
 
44
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
45
 
entrypoint.sh CHANGED
@@ -11,4 +11,4 @@ ollama pull nomic-embed-text:latest
11
 
12
  ollama pull gpt-oss:20b || true
13
 
14
- flask --app src/app run --debug
 
11
 
12
  ollama pull gpt-oss:20b || true
13
 
14
+ exec flask --app src/app run --host=0.0.0.0 --port=$PORT
src/app.py CHANGED
@@ -2,6 +2,10 @@ from flask import Flask
2
 
3
  app = Flask(__name__)
4
 
5
- @app.route('/')
6
- def hello():
7
- return 'Hello, World!'
 
 
 
 
 
2
 
3
  app = Flask(__name__)
4
 
5
+ @app.route("/")
6
+ def home():
7
+ return "Flask + Ollama on Hugging Face Spaces!"
8
+
9
+ @app.route("/health")
10
+ def health():
11
+ return {"status": "ok"}