2025-05-19 09:59:22 -07:00
|
|
|
|
# build docker image for arch gateway
|
2026-02-02 11:03:12 -08:00
|
|
|
|
FROM rust:1.93.0 AS builder
|
2024-11-12 10:35:14 -08:00
|
|
|
|
RUN rustup -v target add wasm32-wasip1
|
2024-09-27 16:41:39 -07:00
|
|
|
|
WORKDIR /arch
|
2024-10-16 14:20:26 -07:00
|
|
|
|
COPY crates .
|
2025-05-19 09:59:22 -07:00
|
|
|
|
RUN cargo build --release --target wasm32-wasip1 -p prompt_gateway -p llm_gateway
|
|
|
|
|
|
RUN cargo build --release -p brightstaff
|
2024-07-30 16:23:23 -07:00
|
|
|
|
|
2025-12-25 20:54:30 -08:00
|
|
|
|
FROM docker.io/envoyproxy/envoy:v1.36.4 AS envoy
|
2024-10-01 10:02:23 -07:00
|
|
|
|
|
2025-08-13 14:20:46 -07:00
|
|
|
|
FROM python:3.13.6-slim AS arch
|
2025-08-12 13:20:04 -07:00
|
|
|
|
# Purge PAM to avoid CVE-2025-6020 and install needed tools
|
|
|
|
|
|
|
|
|
|
|
|
# 1) Install what you need while apt still works
|
|
|
|
|
|
RUN set -eux; \
|
|
|
|
|
|
apt-get update; \
|
|
|
|
|
|
apt-get install -y --no-install-recommends supervisor gettext-base curl; \
|
|
|
|
|
|
apt-get clean; rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
# 2) Force-remove PAM packages (don’t use apt here)
|
|
|
|
|
|
# We ignore dependencies and remove files so scanners don’t find them.
|
|
|
|
|
|
RUN set -eux; \
|
|
|
|
|
|
dpkg -r --force-depends libpam-modules libpam-modules-bin libpam-runtime libpam0g || true; \
|
|
|
|
|
|
dpkg -P --force-all libpam-modules libpam-modules-bin libpam-runtime libpam0g || true; \
|
|
|
|
|
|
rm -rf /etc/pam.d /lib/*/security /usr/lib/security || true
|
2024-10-28 20:05:06 -04:00
|
|
|
|
|
2024-11-12 10:35:14 -08:00
|
|
|
|
COPY --from=builder /arch/target/wasm32-wasip1/release/prompt_gateway.wasm /etc/envoy/proxy-wasm-plugins/prompt_gateway.wasm
|
|
|
|
|
|
COPY --from=builder /arch/target/wasm32-wasip1/release/llm_gateway.wasm /etc/envoy/proxy-wasm-plugins/llm_gateway.wasm
|
2025-05-19 09:59:22 -07:00
|
|
|
|
COPY --from=builder /arch/target/release/brightstaff /app/brightstaff
|
2024-10-01 10:02:23 -07:00
|
|
|
|
COPY --from=envoy /usr/local/bin/envoy /usr/local/bin/envoy
|
2025-05-19 09:59:22 -07:00
|
|
|
|
|
2024-11-15 10:44:01 -08:00
|
|
|
|
WORKDIR /app
|
2025-12-26 11:21:42 -08:00
|
|
|
|
|
|
|
|
|
|
# Install uv using pip
|
|
|
|
|
|
RUN pip install --no-cache-dir uv
|
|
|
|
|
|
|
|
|
|
|
|
# Copy Python dependency files
|
|
|
|
|
|
COPY cli/pyproject.toml ./
|
|
|
|
|
|
COPY cli/uv.lock ./
|
|
|
|
|
|
COPY cli/README.md ./
|
|
|
|
|
|
|
|
|
|
|
|
RUN uv run pip install --no-cache-dir .
|
|
|
|
|
|
|
|
|
|
|
|
# Copy the rest of the application
|
2025-12-25 14:55:29 -08:00
|
|
|
|
COPY cli .
|
|
|
|
|
|
COPY config/envoy.template.yaml .
|
|
|
|
|
|
COPY config/arch_config_schema.yaml .
|
|
|
|
|
|
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
2025-08-12 13:20:04 -07:00
|
|
|
|
RUN mkdir -p /var/log/supervisor && touch /var/log/envoy.log /var/log/supervisor/supervisord.log
|
2025-05-19 09:59:22 -07:00
|
|
|
|
|
2025-09-30 18:46:13 -07:00
|
|
|
|
RUN mkdir -p /var/log && \
|
2026-01-07 08:44:41 -08:00
|
|
|
|
touch /var/log/access_ingress.log /var/log/access_ingress_prompt.log /var/log/access_internal.log /var/log/access_llm.log /var/log/access_agent.log
|
2025-09-30 18:46:13 -07:00
|
|
|
|
|
2025-05-19 09:59:22 -07:00
|
|
|
|
ENTRYPOINT ["sh","-c", "/usr/bin/supervisord"]
|