joseph njoroge kariuki commited on
Commit
b7e0fc5
·
1 Parent(s): eb13a87

fix: install rust to /usr/local so CARGO_HOME persists across Docker layers

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -4
Dockerfile CHANGED
@@ -10,10 +10,17 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
10
  && apt-get install -y nodejs \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # 3. Install Rust (stable toolchain) for Maturin compilation
14
- RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable \
15
- && /root/.cargo/bin/rustup default stable
16
- ENV PATH="/root/.cargo/bin:${PATH}"
 
 
 
 
 
 
 
17
 
18
  # 4. Copy backend requirements and install Python deps + maturin
19
  WORKDIR /app
 
10
  && apt-get install -y nodejs \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # 3. Install Rust stable - set explicit home dirs so they persist across layers
14
+ ENV RUSTUP_HOME=/usr/local/rustup \
15
+ CARGO_HOME=/usr/local/cargo \
16
+ PATH=/usr/local/cargo/bin:${PATH}
17
+
18
+ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y \
19
+ --no-modify-path \
20
+ --default-toolchain stable \
21
+ && rustup default stable \
22
+ && cargo --version \
23
+ && rustc --version
24
 
25
  # 4. Copy backend requirements and install Python deps + maturin
26
  WORKDIR /app