diamond-in commited on
Commit
2a8abed
·
verified ·
1 Parent(s): 860a83d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -6
Dockerfile CHANGED
@@ -1,6 +1,10 @@
1
- # --- Stage 1: Rust Builder ---
2
- FROM rust:1.75-slim-bookworm AS rust-builder
3
  WORKDIR /app
 
 
 
 
4
  COPY Cargo.toml ./
5
  # Create a dummy main to cache dependencies
6
  RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release
@@ -17,7 +21,16 @@ RUN npm run build
17
 
18
  # --- Stage 3: Final Runtime (Nix + Agent) ---
19
  FROM debian:bookworm-slim
20
- RUN apt-get update && apt-get install -y curl xz-utils wget ca-certificates procps
 
 
 
 
 
 
 
 
 
21
  RUN useradd -m -u 1000 user
22
  USER user
23
  ENV HOME=/home/user
@@ -28,13 +41,12 @@ RUN curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
28
  ENV PATH="/home/user/.nix-profile/bin:${PATH}"
29
  ENV NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz
30
 
31
- # Copy built assets from previous stages
32
  COPY --from=rust-builder /app/target/release/polymorphic-agent .
33
  COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
34
 
35
- # Create the dynamic UI folder so the agent can write to it
36
  RUN mkdir -p ./frontend/src/dynamic
37
 
38
  EXPOSE 7860
39
- # Start the backend
40
  CMD ["./polymorphic-agent"]
 
1
+ # --- Stage 1: Rust Builder (Upgraded to 1.84) ---
2
+ FROM rust:1.84-slim-bookworm AS rust-builder
3
  WORKDIR /app
4
+
5
+ # Install system dependencies for building
6
+ RUN apt-get update && apt-get install -y pkg-config libssl-dev
7
+
8
  COPY Cargo.toml ./
9
  # Create a dummy main to cache dependencies
10
  RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo build --release
 
21
 
22
  # --- Stage 3: Final Runtime (Nix + Agent) ---
23
  FROM debian:bookworm-slim
24
+ RUN apt-get update && apt-get install -y \
25
+ curl xz-utils wget ca-certificates procps \
26
+ libssl3 libasound2 libatk1.0-0 libc6 libcairo2 libcups2 \
27
+ libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 \
28
+ libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \
29
+ libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
30
+ libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
31
+ libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
32
+ libxrandr2 libxrender1 libxss1 libxtst6
33
+
34
  RUN useradd -m -u 1000 user
35
  USER user
36
  ENV HOME=/home/user
 
41
  ENV PATH="/home/user/.nix-profile/bin:${PATH}"
42
  ENV NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz
43
 
44
+ # Copy built assets
45
  COPY --from=rust-builder /app/target/release/polymorphic-agent .
46
  COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
47
 
48
+ # Create dynamic folders
49
  RUN mkdir -p ./frontend/src/dynamic
50
 
51
  EXPOSE 7860
 
52
  CMD ["./polymorphic-agent"]