edit sever
Browse files- Dockerfile +43 -9
- README.md +4 -4
- development.md +2 -2
- requirements.txt +3 -1
Dockerfile
CHANGED
@@ -1,16 +1,50 @@
|
|
1 |
FROM python:3.12
|
2 |
-
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
-
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
USER user
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.12
|
|
|
2 |
|
3 |
+
COPY --from=ghcr.io/astral-sh/uv:0.5.1 /uv /bin/uv
|
4 |
+
RUN set -ex \
|
5 |
+
&& chmod 755 /bin/uv \
|
6 |
+
&& useradd --create-home --shell /bin/bash --uid 1000 user
|
7 |
|
8 |
+
# Set environment variables
|
9 |
+
ENV VIRTUAL_ENV=/opt/venv \
|
10 |
+
PATH="/opt/venv/bin:/home/user/.local/bin:$PATH" \
|
11 |
+
HOME=/home/user
|
12 |
|
13 |
+
# Install dependencies
|
14 |
+
COPY --chown=user:user ./requirements.txt requirements.txt
|
15 |
+
RUN uv venv $VIRTUAL_ENV \
|
16 |
+
&& uv pip install --no-cache-dir -r requirements.txt \
|
17 |
+
&& chown -R user:user $VIRTUAL_ENV
|
18 |
|
19 |
+
# Create directories and set permissions
|
20 |
+
RUN mkdir -p $HOME/.cache $HOME/.config /data \
|
21 |
+
&& chown -R user:user $HOME /data \
|
22 |
+
&& chmod -R 755 $HOME /data \
|
23 |
+
&& chown -R user:user /opt/venv
|
24 |
+
|
25 |
+
RUN --mount=type=secret,id=MARIMO_PASSWORD \
|
26 |
+
cat /run/secrets/MARIMO_PASSWORD > $HOME/.marimo_password \
|
27 |
+
&& chmod 600 $HOME/.marimo_password \
|
28 |
+
&& chown user:user $HOME/.marimo_password
|
29 |
+
|
30 |
+
# Set working directory
|
31 |
+
WORKDIR /data
|
32 |
+
|
33 |
+
# Set user
|
34 |
USER user
|
35 |
|
36 |
+
# Use heredoc with explicit delimiter
|
37 |
+
RUN <<'ENDCONFIG' cat > $HOME/.marimo.toml
|
38 |
+
[package_management]
|
39 |
+
manager = "uv"
|
40 |
+
|
41 |
+
[display]
|
42 |
+
cell_output = "below"
|
43 |
+
dataframes = "rich"
|
44 |
+
theme = "light"
|
45 |
+
ENDCONFIG
|
46 |
+
|
47 |
+
|
48 |
+
# Uncomment to enable password protection
|
49 |
+
# CMD marimo edit /data --host=0.0.0.0 --port=7860 --token-password=$(cat $HOME/.marimo_password)
|
50 |
+
CMD marimo edit /data --host=0.0.0.0 --port=7860 --no-token
|
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
7 |
pinned: true
|
8 |
license: mit
|
|
|
1 |
---
|
2 |
+
title: marimo server template
|
3 |
+
emoji: π
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: blue
|
6 |
sdk: docker
|
7 |
pinned: true
|
8 |
license: mit
|
development.md
CHANGED
@@ -3,6 +3,6 @@
|
|
3 |
## Testing your Dockerfile locally
|
4 |
|
5 |
```bash
|
6 |
-
docker build -t marimo-
|
7 |
-
docker run -it --rm -p 7860:7860 marimo-
|
8 |
```
|
|
|
3 |
## Testing your Dockerfile locally
|
4 |
|
5 |
```bash
|
6 |
+
MARIMO_PASSWORD=password docker build -t marimo-editor . --secret id=MARIMO_PASSWORD,env=MARIMO_PASSWORD
|
7 |
+
docker run -it --rm -p 7860:7860 marimo-editor
|
8 |
```
|
requirements.txt
CHANGED
@@ -1,4 +1,6 @@
|
|
1 |
-
marimo
|
|
|
|
|
2 |
# Or a specific version
|
3 |
# marimo>=0.9.0
|
4 |
|
|
|
1 |
+
marimo[sql]
|
2 |
+
polars
|
3 |
+
altair
|
4 |
# Or a specific version
|
5 |
# marimo>=0.9.0
|
6 |
|