molehh commited on
Commit
1a3780c
·
1 Parent(s): 6ccf7f2

frontend deploy

Browse files
Files changed (2) hide show
  1. Dockerfile +15 -9
  2. app.py +0 -12
Dockerfile CHANGED
@@ -1,15 +1,21 @@
1
- FROM python:3.9
2
-
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
 
 
7
  WORKDIR /app
8
 
9
- COPY --chown=user ./requirements.txt requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
11
 
 
12
  EXPOSE 7860
13
 
14
- COPY --chown=user . /app
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Python 3.11 as the base image
2
+ FROM python:3.11-slim
 
 
 
3
 
4
+ # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Copy all project files into the container
8
+ COPY . /app
9
+
10
+ # Install dependencies
11
+ RUN pip install --upgrade pip
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Set PYTHONPATH so FastAPI can find the 'backend' module
15
+ ENV PYTHONPATH=/app
16
 
17
+ # Expose the port that Streamlit runs on
18
  EXPOSE 7860
19
 
20
+ # Run Streamlit when the container starts
21
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
app.py CHANGED
@@ -1,16 +1,4 @@
1
- # # import streamlit as st
2
- # # import requests
3
 
4
- # # st.title("world population dashboard")
5
- # # base_url="http://127.0.0.1:8001"
6
-
7
- # # response=requests.get(f"{base_url}/continent")
8
-
9
- # # if response.status_code==200:
10
-
11
- # # continents=(response.json().get("continents"))
12
-
13
- # # st.selectbox("select a continent",continents)
14
 
15
  import streamlit as st
16
  import requests
 
 
 
1
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  import streamlit as st
4
  import requests