Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- Dockerfile +8 -6
- docker-compose.yaml +12 -0
- requirements.txt +4 -5
- streamlit_app.py +21 -0
Dockerfile
CHANGED
@@ -1,11 +1,13 @@
|
|
1 |
FROM python:3.9-slim
|
2 |
EXPOSE 8501
|
3 |
WORKDIR /app
|
|
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
&& rm -rf /var/lib/apt/lists/*
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
EXPOSE 8501
|
3 |
WORKDIR /app
|
4 |
+
COPY . .
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
+
python3-tk \
|
7 |
+
libgl1-mesa-glx \
|
8 |
+
libglib2.0-0 \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
11 |
+
ENV MPLBACKEND=Agg
|
12 |
+
# RUN pip3 install -r requirements.txt
|
13 |
+
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
docker-compose.yaml
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
services:
|
2 |
+
streamlit:
|
3 |
+
build:
|
4 |
+
dockerfile: Dockerfile
|
5 |
+
context: .
|
6 |
+
container_name: streamlit-app
|
7 |
+
cpus: 0.5
|
8 |
+
mem_limit: 1024m
|
9 |
+
ports:
|
10 |
+
- "8501:8501"
|
11 |
+
volumes:
|
12 |
+
- ".:/app:rw"
|
requirements.txt
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
-
altair
|
2 |
-
polars
|
3 |
pandas
|
|
|
4 |
streamlit
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
1 |
pandas
|
2 |
+
polars
|
3 |
streamlit
|
4 |
+
plotly
|
5 |
+
requests
|
6 |
+
matplotlib
|
streamlit_app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
st.sidebar.title("Navigation")
|
4 |
+
page = st.sidebar.radio(
|
5 |
+
"Select a Page",
|
6 |
+
["Single Location Weather",
|
7 |
+
"Compare Locations & KPIs",
|
8 |
+
"Variable Selection & Timezone",
|
9 |
+
"Summary Metrics Across Cities"]
|
10 |
+
)
|
11 |
+
|
12 |
+
if page == "Single Location Weather":
|
13 |
+
from pages.single_location import main
|
14 |
+
elif page == "Compare Locations & KPIs":
|
15 |
+
from pages.compare_locations import main
|
16 |
+
elif page == "Variable Selection & Timezone":
|
17 |
+
from pages.variable_selection import main
|
18 |
+
elif page == "Summary Metrics Across Cities":
|
19 |
+
from pages.summary_metrics import main
|
20 |
+
|
21 |
+
main()
|