Spaces:
Sleeping
Sleeping
port
Browse files- Dockerfile +2 -2
- _server/README.md +1 -1
- _server/main.py +13 -2
Dockerfile
CHANGED
@@ -7,7 +7,7 @@ COPY duckdb/ duckdb/
|
|
7 |
RUN uv venv
|
8 |
RUN uv export --script _server/main.py | uv pip install -r -
|
9 |
|
10 |
-
ENV PORT=
|
11 |
-
EXPOSE
|
12 |
|
13 |
CMD ["uv", "run", "_server/main.py"]
|
|
|
7 |
RUN uv venv
|
8 |
RUN uv export --script _server/main.py | uv pip install -r -
|
9 |
|
10 |
+
ENV PORT=7860
|
11 |
+
EXPOSE 7860
|
12 |
|
13 |
CMD ["uv", "run", "_server/main.py"]
|
_server/README.md
CHANGED
@@ -17,5 +17,5 @@ docker build -t marimo-learn .
|
|
17 |
## Running the Docker container
|
18 |
|
19 |
```bash
|
20 |
-
docker run -p
|
21 |
```
|
|
|
17 |
## Running the Docker container
|
18 |
|
19 |
```bash
|
20 |
+
docker run -p 7860:7860 marimo-learn
|
21 |
```
|
_server/main.py
CHANGED
@@ -6,12 +6,20 @@
|
|
6 |
# "starlette",
|
7 |
# "python-dotenv",
|
8 |
# "pydantic",
|
9 |
-
# "polars",
|
10 |
# "duckdb",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# ]
|
12 |
# ///
|
13 |
|
14 |
import logging
|
|
|
15 |
from pathlib import Path
|
16 |
|
17 |
import marimo
|
@@ -26,6 +34,9 @@ load_dotenv()
|
|
26 |
logging.basicConfig(level=logging.INFO)
|
27 |
logger = logging.getLogger(__name__)
|
28 |
|
|
|
|
|
|
|
29 |
root_dir = Path(__file__).parent.parent
|
30 |
|
31 |
ROOTS = [
|
@@ -76,4 +87,4 @@ app.mount("/", server.build())
|
|
76 |
if __name__ == "__main__":
|
77 |
import uvicorn
|
78 |
|
79 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
|
6 |
# "starlette",
|
7 |
# "python-dotenv",
|
8 |
# "pydantic",
|
|
|
9 |
# "duckdb",
|
10 |
+
# "altair==5.5.0",
|
11 |
+
# "beautifulsoup4==4.13.3",
|
12 |
+
# "httpx==0.28.1",
|
13 |
+
# "marimo",
|
14 |
+
# "nest-asyncio==1.6.0",
|
15 |
+
# "numba==0.61.0",
|
16 |
+
# "numpy==2.1.3",
|
17 |
+
# "polars==1.24.0",
|
18 |
# ]
|
19 |
# ///
|
20 |
|
21 |
import logging
|
22 |
+
import os
|
23 |
from pathlib import Path
|
24 |
|
25 |
import marimo
|
|
|
34 |
logging.basicConfig(level=logging.INFO)
|
35 |
logger = logging.getLogger(__name__)
|
36 |
|
37 |
+
# Get port from environment variable or use default
|
38 |
+
PORT = int(os.environ.get("PORT", 7860))
|
39 |
+
|
40 |
root_dir = Path(__file__).parent.parent
|
41 |
|
42 |
ROOTS = [
|
|
|
87 |
if __name__ == "__main__":
|
88 |
import uvicorn
|
89 |
|
90 |
+
uvicorn.run(app, host="0.0.0.0", port=PORT, log_level="info")
|