mylessss commited on
Commit
a1166f2
Β·
1 Parent(s): 39cc06c

edit sever

Browse files
Files changed (4) hide show
  1. Dockerfile +43 -9
  2. README.md +4 -4
  3. development.md +2 -2
  4. 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
- RUN useradd -m -u 1000 user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
- ENV UV_SYSTEM_PYTHON=1
 
7
 
8
- WORKDIR /app
 
 
 
9
 
10
- COPY --chown=user ./requirements.txt requirements.txt
11
- RUN uv pip install -r requirements.txt
 
 
 
12
 
13
- COPY --chown=user . /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  USER user
15
 
16
- CMD ["marimo", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: Marimo Server Template
3
- emoji: πŸƒ
4
- colorFrom: indigo
5
- colorTo: purple
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-app .
7
- docker run -it --rm -p 7860:7860 marimo-app
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