Update Dockerfile
Browse files- Dockerfile +81 -13
Dockerfile
CHANGED
|
@@ -1,20 +1,88 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import folium
|
| 4 |
+
from streamlit_folium import st_folium
|
| 5 |
+
from datetime import datetime
|
| 6 |
|
| 7 |
+
# --- GEN Z DESIGN: CUSTOM CSS ---
|
| 8 |
+
st.set_page_config(page_title="Maldives Vessel Tracker", page_icon="π’", layout="wide")
|
| 9 |
|
| 10 |
+
st.markdown("""
|
| 11 |
+
<style>
|
| 12 |
+
/* Maldivian Blue Gradient Header */
|
| 13 |
+
.main {
|
| 14 |
+
background: linear-gradient(135deg, #0077B6 0%, #00B4D8 50%, #90E0EF 100%);
|
| 15 |
+
color: white;
|
| 16 |
+
}
|
| 17 |
+
.stApp {
|
| 18 |
+
background-color: #f8f9fa;
|
| 19 |
+
}
|
| 20 |
+
.vessel-card {
|
| 21 |
+
background: white;
|
| 22 |
+
padding: 20px;
|
| 23 |
+
border-radius: 20px;
|
| 24 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
| 25 |
+
margin-bottom: 15px;
|
| 26 |
+
color: #333;
|
| 27 |
+
}
|
| 28 |
+
.status-badge {
|
| 29 |
+
padding: 5px 12px;
|
| 30 |
+
border-radius: 15px;
|
| 31 |
+
font-size: 0.8em;
|
| 32 |
+
font-weight: bold;
|
| 33 |
+
}
|
| 34 |
+
</style>
|
| 35 |
+
""", unsafe_allow_html=True)
|
| 36 |
|
| 37 |
+
# --- MOCK DATA: CONNECTED TO YOUR ANDROID LOGIC ---
|
| 38 |
+
vessel_data = [
|
| 39 |
+
{"id": 1, "name": "Aanu Quick", "type": "Speedboat", "status": "Live: On Time", "lat": 4.1755, "lon": 73.5093, "speed": "31 knots"},
|
| 40 |
+
{"id": 2, "name": "Coral Express", "type": "Ferry", "status": "Delayed", "lat": 4.1910, "lon": 73.5200, "speed": "12 knots"},
|
| 41 |
+
{"id": 3, "name": "Dhon Hiri", "type": "Dhoni", "status": "Live: On Time", "lat": 4.2100, "lon": 73.5350, "speed": "22 knots"},
|
| 42 |
+
{"id": 4, "name": "Altec Dash", "type": "Speedboat", "status": "Scheduled", "lat": 4.1850, "lon": 73.5150, "speed": "0 knots"}
|
| 43 |
+
]
|
| 44 |
+
df = pd.DataFrame(vessel_data)
|
| 45 |
|
| 46 |
+
# --- HEADER ---
|
| 47 |
+
st.title("π Maldives Vessel Tracker")
|
| 48 |
+
st.write(f"Last Synced with FollowMe: {datetime.now().strftime('%H:%M:%S')}")
|
| 49 |
|
| 50 |
+
# --- LAYOUT: MAP & LIST ---
|
| 51 |
+
col1, col2 = st.columns([2, 1])
|
| 52 |
|
| 53 |
+
with col1:
|
| 54 |
+
st.subheader("π Live Fleet Map")
|
| 55 |
+
# Modern Map centered on Male'
|
| 56 |
+
m = folium.Map(location=[4.1850, 73.5150], zoom_start=13, tiles="CartoDB positron")
|
| 57 |
+
|
| 58 |
+
for _, boat in df.iterrows():
|
| 59 |
+
color = "green" if "On Time" in boat["status"] else "orange" if "Delayed" in boat["status"] else "gray"
|
| 60 |
+
folium.Marker(
|
| 61 |
+
[boat["lat"], boat["lon"]],
|
| 62 |
+
popup=f"<b>{boat['name']}</b><br>Speed: {boat['speed']}",
|
| 63 |
+
icon=folium.Icon(color=color, icon="ship", prefix="fa")
|
| 64 |
+
).add_to(m)
|
| 65 |
+
|
| 66 |
+
st_folium(m, width="100%", height=500)
|
| 67 |
|
| 68 |
+
with col2:
|
| 69 |
+
st.subheader("π’ Vessel List")
|
| 70 |
+
search = st.text_input("Search (e.g. 'Aanu')", "")
|
| 71 |
+
|
| 72 |
+
for _, boat in df.iterrows():
|
| 73 |
+
if search.lower() in boat["name"].lower():
|
| 74 |
+
with st.container():
|
| 75 |
+
st.markdown(f"""
|
| 76 |
+
<div class="vessel-card">
|
| 77 |
+
<h3 style="margin:0;">{boat['name']}</h3>
|
| 78 |
+
<p style="color:gray; margin-bottom:10px;">{boat['type']} β’ {boat['speed']}</p>
|
| 79 |
+
<span class="status-badge" style="background:#e1f5fe; color:#01579b;">{boat['status']}</span>
|
| 80 |
+
</div>
|
| 81 |
+
""", unsafe_allow_html=True)
|
| 82 |
+
if st.button(f"Pay 50 MVR for {boat['name']}", key=boat['id']):
|
| 83 |
+
st.balloons()
|
| 84 |
+
st.success("Payment successful! π«")
|
| 85 |
+
|
| 86 |
+
# --- FOOTER ---
|
| 87 |
+
st.divider()
|
| 88 |
+
st.info("π‘ Note: This is a web preview. For the full experience with real-time push notifications, download the Android APK.")
|