Spaces:
Sleeping

faseehsandhu commited on
Commit
fd01938
ยท
1 Parent(s): 9b622e7

Add Dockerfile for Docker SDK deployment

Browse files
Files changed (3) hide show
  1. Dockerfile +16 -0
  2. README.md +2 -3
  3. app.py +1 -8
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ WORKDIR /app
4
+
5
+ # Copy requirements and install dependencies
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+
9
+ # Copy all application files
10
+ COPY . .
11
+
12
+ # Expose port 7860 (HF Spaces default)
13
+ EXPOSE 7860
14
+
15
+ # Run the Streamlit app
16
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
README.md CHANGED
@@ -3,9 +3,8 @@ title: Data Dictionary Chatbot
3
  emoji: ๐Ÿ“š
4
  colorFrom: blue
5
  colorTo: purple
6
- sdk: streamlit
7
- sdk_version: "1.32.0"
8
- app_file: app.py
9
  pinned: false
10
  ---
11
 
 
3
  emoji: ๐Ÿ“š
4
  colorFrom: blue
5
  colorTo: purple
6
+ sdk: docker
7
+ app_port: 7860
 
8
  pinned: false
9
  ---
10
 
app.py CHANGED
@@ -1,10 +1,6 @@
1
  """
2
  Main entry point for Hugging Face Spaces deployment.
3
  """
4
- import streamlit as st
5
-
6
- st.write("## TEST: File is being executed!")
7
-
8
  import sys
9
  from pathlib import Path
10
 
@@ -12,17 +8,14 @@ from pathlib import Path
12
  src_path = Path(__file__).parent / "src"
13
  sys.path.insert(0, str(src_path))
14
 
15
- st.write(f"Source path: {src_path}")
16
- st.write(f"Path exists: {src_path.exists()}")
17
-
18
  try:
19
  # Import the main module
20
  import app as src_app
21
- st.write("โœ… Successfully imported src.app")
22
 
23
  # Run the main function
24
  src_app.main()
25
  except Exception as e:
 
26
  st.error(f"Error loading application: {e}")
27
  st.code(f"{type(e).__name__}: {e}")
28
  import traceback
 
1
  """
2
  Main entry point for Hugging Face Spaces deployment.
3
  """
 
 
 
 
4
  import sys
5
  from pathlib import Path
6
 
 
8
  src_path = Path(__file__).parent / "src"
9
  sys.path.insert(0, str(src_path))
10
 
 
 
 
11
  try:
12
  # Import the main module
13
  import app as src_app
 
14
 
15
  # Run the main function
16
  src_app.main()
17
  except Exception as e:
18
+ import streamlit as st
19
  st.error(f"Error loading application: {e}")
20
  st.code(f"{type(e).__name__}: {e}")
21
  import traceback