Spaces:
Running
Running
| # ---- build the two Rust tools ---- | |
| FROM rust:1.95-slim AS build | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git pkg-config libssl-dev ca-certificates build-essential && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /b | |
| RUN git clone --depth 1 https://github.com/neul-labs/grite.git grite \ | |
| && cd grite && cargo build --release -p grite && strip target/release/grite | |
| RUN git clone --depth 1 https://github.com/neul-labs/agentvfs.git avfs \ | |
| && cd avfs && cargo build --release && strip target/release/avfs | |
| # ---- runtime: binaries + python tools + gradio ---- | |
| FROM python:3.12-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git libssl3 libsqlite3-0 ca-certificates && rm -rf /var/lib/apt/lists/* | |
| COPY --from=build /b/grite/target/release/grite /usr/local/bin/grite | |
| COPY --from=build /b/avfs/target/release/avfs /usr/local/bin/avfs | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user PATH=/home/user/.local/bin:/usr/local/bin:$PATH \ | |
| GRITE_BIN=/usr/local/bin/grite AVFS_BIN=/usr/local/bin/avfs AVFS_HOME=/home/user/vaults \ | |
| CLOSEGATE_DIR=/home/user/closegate ORMAI_ENV=development \ | |
| GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 | |
| WORKDIR /home/user | |
| RUN git clone --depth 1 https://github.com/neul-labs/closegate.git closegate && mkdir -p /home/user/vaults | |
| RUN pip install --user --no-cache-dir ormai sqlalchemy gradio \ | |
| ./closegate/packages/closegate_policy ./closegate/packages/closegate_engine | |
| WORKDIR /home/user/app | |
| COPY --chown=user app.py grite_mod.py ormai_mod.py avfs_mod.py closegate_mod.py ./ | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |