subatomicERROR commited on
Commit
29725ad
·
1 Parent(s): 71ce173

Added Dockerfile and start.sh for Hugging Face deployment: FastAPI on 7860, Streamlit on 8000

Browse files
Files changed (3) hide show
  1. Dockerfile +21 -0
  2. README.md +5 -5
  3. start.sh +0 -0
Dockerfile CHANGED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official slim Python 3.12 image
2
+ FROM python:3.12-slim
3
+
4
+ # Set working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy all project files into the container
8
+ COPY . /app
9
+
10
+ # Ensure start.sh is executable
11
+ RUN chmod +x /app/start.sh
12
+
13
+ # Install required Python packages
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Expose FastAPI on port 7860 and Streamlit on port 8000
17
+ EXPOSE 7860
18
+ EXPOSE 8000
19
+
20
+ # Launch both servers using start.sh
21
+ CMD ["/app/start.sh"]
README.md CHANGED
@@ -95,10 +95,10 @@ Accessible at: [http://localhost:7860](http://localhost:7860)
95
 
96
  ### 2. Start the Frontend (Streamlit)
97
  ```bash
98
- streamlit run app/app.py --server.port 7861
99
  ```
100
 
101
- Accessible at: [http://localhost:7861](http://localhost:7861)
102
 
103
  ---
104
 
@@ -143,10 +143,10 @@ Returns API status.
143
  An interactive interface to interact with the quantum backend.
144
 
145
  ```bash
146
- streamlit run app/app.py --server.port 7861
147
  ```
148
 
149
- URL: [http://localhost:7861](http://localhost:7861)
150
 
151
  ---
152
 
@@ -162,7 +162,7 @@ Ensure the following in your repo:
162
  Use a Docker-based Space with this command in Dockerfile or runtime:
163
  ```bash
164
  uvicorn api.endpoints.codelama:app --host 0.0.0.0 --port 7860 & \
165
- streamlit run app/app.py --server.port 7861
166
  ```
167
 
168
  Push your repo to Hugging Face:
 
95
 
96
  ### 2. Start the Frontend (Streamlit)
97
  ```bash
98
+ streamlit run app/app.py --server.port 8000
99
  ```
100
 
101
+ Accessible at: [http://localhost:8000](http://localhost:8000)
102
 
103
  ---
104
 
 
143
  An interactive interface to interact with the quantum backend.
144
 
145
  ```bash
146
+ streamlit run app/app.py --server.port 8000
147
  ```
148
 
149
+ URL: [http://localhost:8000](http://localhost:8000)
150
 
151
  ---
152
 
 
162
  Use a Docker-based Space with this command in Dockerfile or runtime:
163
  ```bash
164
  uvicorn api.endpoints.codelama:app --host 0.0.0.0 --port 7860 & \
165
+ streamlit run app/app.py --server.port 8000
166
  ```
167
 
168
  Push your repo to Hugging Face:
start.sh ADDED
File without changes