Rob McKnight commited on
Commit
ab571e0
·
1 Parent(s): e79ca37

back to user

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -12
Dockerfile CHANGED
@@ -10,30 +10,43 @@ RUN apt-get update && apt-get install -y \
10
  # Set up uv
11
  COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
12
 
13
- # Set up directories
14
- RUN mkdir -p /app/.marimo /app/.config /mnt/workspace
15
-
16
- ENV PATH="/root/.local/bin:$PATH"
 
 
 
 
 
 
 
 
17
  ENV UV_SYSTEM_PYTHON=1
18
- ENV HOME=/app
19
- ENV XDG_CONFIG_HOME=/app/.config
20
- ENV MARIMO_CONFIG_DIR=/app/.marimo
21
 
22
- # Clone trieve
 
23
  RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
24
  cd /mnt/workspace && \
25
  git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
26
 
 
 
 
27
  # Set up marimo
28
  WORKDIR /app
29
- COPY requirements.txt .
30
  RUN pip install --break-system-packages -r requirements.txt
31
- COPY . .
32
 
33
- # Copy start script
34
- COPY start.sh /start.sh
35
  RUN chmod +x /start.sh
36
 
37
  EXPOSE 7860
38
 
 
39
  CMD ["/start.sh"]
 
10
  # Set up uv
11
  COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
12
 
13
+ # Create user first
14
+ RUN useradd -m -u 1000 user
15
+
16
+ # Create directories with proper permissions
17
+ RUN mkdir -p /home/user/.marimo && \
18
+ mkdir -p /home/user/.config && \
19
+ mkdir -p /mnt/workspace && \
20
+ chown -R user:user /home/user/.marimo && \
21
+ chown -R user:user /home/user/.config && \
22
+ chown -R user:user /mnt/workspace
23
+
24
+ ENV PATH="/home/user/.local/bin:$PATH"
25
  ENV UV_SYSTEM_PYTHON=1
26
+ ENV HOME=/home/user
27
+ ENV XDG_CONFIG_HOME=/home/user/.config
28
+ ENV MARIMO_CONFIG_DIR=/home/user/.marimo
29
 
30
+ # Clone trieve as user
31
+ USER user
32
  RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
33
  cd /mnt/workspace && \
34
  git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
35
 
36
+ # Switch back to root for remaining setup
37
+ USER root
38
+
39
  # Set up marimo
40
  WORKDIR /app
41
+ COPY --chown=user ./requirements.txt requirements.txt
42
  RUN pip install --break-system-packages -r requirements.txt
43
+ COPY --chown=user . /app
44
 
45
+ # Copy and set up start script
46
+ COPY --chown=user start.sh /start.sh
47
  RUN chmod +x /start.sh
48
 
49
  EXPOSE 7860
50
 
51
+ # Start both processes using the script
52
  CMD ["/start.sh"]