Rob McKnight commited on
Commit
ed943a2
·
1 Parent(s): 67054e5

Permissions

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -37
Dockerfile CHANGED
@@ -1,53 +1,30 @@
1
  FROM agenticlabs/lsproxy:0.1.1
2
 
3
- # Install Python, pip, and git
4
  RUN apt-get update && apt-get install -y \
5
- procps \
6
  python3 \
7
  python3-pip \
8
- python3-venv \
9
  git \
10
- && rm -rf /var/lib/apt/lists/*
 
 
 
11
 
12
- # Create user and all necessary directories
13
- RUN useradd -u 1000 -m appuser && \
14
- mkdir -p /app /mnt/workspace && \
15
- # Create rust-analyzer directories
16
- mkdir -p /home/appuser/.cache/rust-analyzer && \
17
- mkdir -p /home/appuser/.config/rust-analyzer && \
18
- # Create marimo directories
19
- mkdir -p /home/appuser/.cache/marimo && \
20
- mkdir -p /home/appuser/.config/marimo && \
21
- mkdir -p /home/appuser/.local/share/marimo
22
-
23
- # Set up Python environment
24
- RUN python3 -m venv /opt/venv
25
- ENV PATH="/opt/venv/bin:$PATH"
26
-
27
- ENV RUST_LOG=trace
28
-
29
- # Set up marimo
30
  WORKDIR /app
31
- COPY requirements.txt requirements.txt
32
- COPY tutorial.py tutorial.py
33
  RUN pip install --break-system-packages -r requirements.txt
34
 
35
- # Clone workspace
 
 
 
36
  RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
37
  cd /mnt/workspace && \
38
  git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
39
 
40
- # Copy start script
41
  COPY start.sh /start.sh
 
42
 
43
- # Set permissions for user 1000
44
- RUN chown -R appuser:appuser /app /home/appuser && \
45
- chown -R appuser:appuser /mnt/workspace && \
46
- chown -R appuser:appuser /usr/local/rustup
47
-
48
- # Set home directory for XDG base directories
49
- ENV HOME=/home/appuser
50
-
51
- EXPOSE 7860
52
-
53
- CMD ["/start.sh"]
 
1
  FROM agenticlabs/lsproxy:0.1.1
2
 
3
+ # Combine all apt operations and user/directory setup in one layer
4
  RUN apt-get update && apt-get install -y \
 
5
  python3 \
6
  python3-pip \
 
7
  git \
8
+ && rm -rf /var/lib/apt/lists/* \
9
+ && useradd -m -u 1000 appuser \
10
+ && mkdir -p /mnt/workspace /usr/local/cargo \
11
+ && chown -R appuser:appuser /mnt/workspace /usr/local/cargo
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  WORKDIR /app
14
+ COPY requirements.txt tutorial.py ./
 
15
  RUN pip install --break-system-packages -r requirements.txt
16
 
17
+ EXPOSE 7860
18
+
19
+ # Combine git operations and file ownership changes in one layer
20
+ USER appuser
21
  RUN git clone https://github.com/devflowinc/trieve /mnt/workspace && \
22
  cd /mnt/workspace && \
23
  git checkout e65889a13715e8833e7cccfe0168b57c1fc966cc
24
 
25
+ USER root
26
  COPY start.sh /start.sh
27
+ RUN chmod +x /start.sh && chown -R appuser:appuser /mnt/workspace /start.sh /app
28
 
29
+ USER appuser
30
+ CMD ["/start.sh"]