Spaces:
Running
Running
server: update docker perms
Browse files- Dockerfile +13 -0
- _server/README.md +3 -0
Dockerfile
CHANGED
@@ -1,9 +1,22 @@
|
|
1 |
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
COPY _server/main.py _server/main.py
|
4 |
COPY polars/ polars/
|
5 |
COPY duckdb/ duckdb/
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
RUN uv venv
|
8 |
RUN uv export --script _server/main.py | uv pip install -r -
|
9 |
|
|
|
1 |
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
2 |
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
# Create a non-root user
|
6 |
+
RUN useradd -m appuser
|
7 |
+
|
8 |
+
# Copy application files
|
9 |
COPY _server/main.py _server/main.py
|
10 |
COPY polars/ polars/
|
11 |
COPY duckdb/ duckdb/
|
12 |
|
13 |
+
# Set proper ownership
|
14 |
+
RUN chown -R appuser:appuser /app
|
15 |
+
|
16 |
+
# Switch to non-root user
|
17 |
+
USER appuser
|
18 |
+
|
19 |
+
# Create virtual environment and install dependencies
|
20 |
RUN uv venv
|
21 |
RUN uv export --script _server/main.py | uv pip install -r -
|
22 |
|
_server/README.md
CHANGED
@@ -5,11 +5,14 @@ This folder contains server code for hosting marimo apps.
|
|
5 |
## Running the server
|
6 |
|
7 |
```bash
|
|
|
8 |
uv run --no-project main.py
|
9 |
```
|
10 |
|
11 |
## Building a Docker image
|
12 |
|
|
|
|
|
13 |
```bash
|
14 |
docker build -t marimo-learn .
|
15 |
```
|
|
|
5 |
## Running the server
|
6 |
|
7 |
```bash
|
8 |
+
cd _server
|
9 |
uv run --no-project main.py
|
10 |
```
|
11 |
|
12 |
## Building a Docker image
|
13 |
|
14 |
+
From the root directory, run:
|
15 |
+
|
16 |
```bash
|
17 |
docker build -t marimo-learn .
|
18 |
```
|