Rob McKnight commited on
Commit
f715547
·
1 Parent(s): b040a50

Back to bash lol

Browse files
Files changed (3) hide show
  1. Dockerfile +13 -20
  2. start.sh +24 -0
  3. supervisord.conf +0 -23
Dockerfile CHANGED
@@ -4,43 +4,36 @@ FROM agenticlabs/lsproxy:0.1.1
4
  RUN apt-get update && apt-get install -y \
5
  python3 \
6
  python3-pip \
7
- supervisor \
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  # Set up uv
12
  COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
13
- RUN useradd -m -u 1000 user
14
 
15
- # Set up marimo config directory with proper permissions
16
- RUN mkdir -p /home/user/.marimo && \
17
- chown -R user:user /home/user/.marimo
18
 
19
- ENV PATH="/home/user/.local/bin:$PATH"
20
  ENV UV_SYSTEM_PYTHON=1
21
- ENV HOME=/home/user
22
- ENV XDG_CONFIG_HOME=/home/user/.config
23
- ENV MARIMO_CONFIG_DIR=/home/user/.marimo
24
 
25
- # Clone specific commit of trieve
26
  RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
27
  cd /mnt/workspace && \
28
  git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
29
 
30
  # Set up marimo
31
  WORKDIR /app
32
- COPY --chown=user ./requirements.txt requirements.txt
33
  RUN pip install --break-system-packages -r requirements.txt
34
- COPY --chown=user . /app
35
 
36
- # Set up supervisor with proper permissions
37
- RUN mkdir -p /var/log/supervisor && \
38
- chown -R user:user /var/log/supervisor && \
39
- mkdir -p /var/run && \
40
- chown -R user:user /var/run
41
- COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
42
 
43
  EXPOSE 7860
44
 
45
- # Start supervisor to manage both processes
46
- CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
 
4
  RUN apt-get update && apt-get install -y \
5
  python3 \
6
  python3-pip \
 
7
  git \
8
  && rm -rf /var/lib/apt/lists/*
9
 
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 /root/.marimo /root/.config /mnt/workspace
 
15
 
16
+ ENV PATH="/root/.local/bin:$PATH"
17
  ENV UV_SYSTEM_PYTHON=1
18
+ ENV HOME=/root
19
+ ENV XDG_CONFIG_HOME=/root/.config
20
+ ENV MARIMO_CONFIG_DIR=/root/.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"]
 
start.sh ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Start lsproxy in the workspace directory
4
+ cd /mnt/workspace
5
+ /lsproxy &
6
+ LSPROXY_PID=$!
7
+
8
+ # Start marimo in the app directory
9
+ cd /app
10
+ marimo run tutorial.py --host 0.0.0.0 --port 7860 &
11
+ MARIMO_PID=$!
12
+
13
+ # Handle shutdown gracefully
14
+ cleanup() {
15
+ echo "Shutting down processes..."
16
+ kill $LSPROXY_PID
17
+ kill $MARIMO_PID
18
+ exit 0
19
+ }
20
+
21
+ trap cleanup SIGTERM SIGINT
22
+
23
+ # Wait for either process to exit
24
+ wait $LSPROXY_PID $MARIMO_PID
supervisord.conf DELETED
@@ -1,23 +0,0 @@
1
- [supervisord]
2
- nodaemon=true
3
- logfile=/var/log/supervisor/supervisord.log
4
- loglevel=debug
5
- user=user
6
-
7
- [program:lsproxy]
8
- command=/lsproxy
9
- environment=RUST_LOG=info,RA_LOG=/tmp/rust-analyzer.log
10
- stdout_logfile=/var/log/supervisor/lsproxy.log
11
- stderr_logfile=/var/log/supervisor/lsproxy.err
12
- autorestart=true
13
- startretries=5
14
-
15
- [program:marimo]
16
- command=marimo run tutorial.py --host 0.0.0.0 --port 7860
17
- user=user
18
- directory=/app
19
- stdout_logfile=/var/log/supervisor/marimo.log
20
- stderr_logfile=/var/log/supervisor/marimo.err
21
- autorestart=true
22
- startretries=5
23
- environment=HOME="/home/user",XDG_CONFIG_HOME="/home/user/.config",MARIMO_CONFIG_DIR="/home/user/.marimo",PYTHONUNBUFFERED=1