davidgasquez commited on
Commit
868b9c4
·
verified ·
1 Parent(s): 4dec51a

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -0
  2. app.py +47 -0
Dockerfile ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ghcr.io/marimo-team/marimo:latest-sql
2
+
3
+ WORKDIR /app
4
+
5
+ RUN pip install polars duckdb pyarrow altair vegafusion
6
+
7
+ COPY app.py .
8
+
9
+ RUN useradd -m app_user
10
+ USER app_user
11
+
12
+ CMD [ "marimo", "run", "app.py", "--host", "0.0.0.0", "-p", "7860" ]
app.py ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import marimo
2
+
3
+ __generated_with = "0.8.11"
4
+ app = marimo.App(width="medium", app_title="Marimo Example")
5
+
6
+
7
+ @app.cell
8
+ def __():
9
+ import marimo as mo
10
+ return mo,
11
+
12
+
13
+ @app.cell
14
+ def __(mo):
15
+ mo.md("""Hello World!""")
16
+ return
17
+
18
+
19
+ @app.cell
20
+ def __(mo):
21
+ lineitem = mo.sql(
22
+ f"""
23
+ SELECT * FROM 'https://shell.duckdb.org/data/tpch/0_01/parquet/lineitem.parquet';
24
+ """
25
+ )
26
+ return lineitem,
27
+
28
+
29
+ @app.cell
30
+ def __(lineitem, mo):
31
+ import altair as alt
32
+
33
+ chart = mo.ui.altair_chart(alt.Chart(lineitem.sample(500)).mark_point().encode(
34
+ x='l_quantity',
35
+ y='l_extendedprice'
36
+ ))
37
+ return alt, chart
38
+
39
+
40
+ @app.cell
41
+ def __(chart, mo):
42
+ mo.vstack([chart, chart.value])
43
+ return
44
+
45
+
46
+ if __name__ == "__main__":
47
+ app.run()