Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ This repository contains two equivalent implementations:

```bash
cd python
podman build -t asksage-openai-proxy .
podman run -p 8000:8000 -e ASKSAGE_API_KEY="your-key" asksage-openai-proxy
podman build -t asksage-openai-proxy-python .
podman run -p 8000:8000 -e ASKSAGE_API_KEY="your-key" asksage-openai-proxy-python
```

See [docs/python-proxy.md](docs/python-proxy.md) for full details.
Expand Down
4 changes: 2 additions & 2 deletions docs/python-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ From the `python/` directory:

```bash
cd python
podman build -f Containerfile -t asksage-openai-proxy:latest .
podman build -f Containerfile -t asksage-openai-proxy-python:latest .
```

### Run (rootless)
Expand All @@ -49,7 +49,7 @@ export ASKSAGE_API_KEY="YOUR_API_KEY"
podman run --rm -p 8000:8000 \
-e ASKSAGE_API_KEY \
-e ASKSAGE_SERVER_BASE="https://api.genai.army.mil/server/" \
asksage-openai-proxy:latest
asksage-openai-proxy-python:latest
```

### Smoke test
Expand Down
24 changes: 12 additions & 12 deletions docs/run-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ This guide explains how to build and run the proxy using Docker or Podman. Both
**Docker:**
```bash
cd python
docker build -t asksage-python-proxy .
docker build -t asksage-openai-proxy-python .
```

**Podman:**
```bash
cd python
podman build -t asksage-python-proxy .
podman build -t asksage-openai-proxy-python .
```

### Running
Expand All @@ -25,17 +25,17 @@ podman build -t asksage-python-proxy .
docker run -d \
-p 8000:8000 \
-e ASKSAGE_API_KEY="your-key-here" \
--name asksage-proxy \
asksage-python-proxy
--name asksage-openai-proxy-python \
asksage-openai-proxy-python
```

**Podman:**
```bash
podman run -d \
-p 8000:8000 \
-e ASKSAGE_API_KEY="your-key-here" \
--name asksage-proxy \
asksage-python-proxy
--name asksage-openai-proxy-python \
asksage-openai-proxy-python
```

## PowerShell Version
Expand All @@ -45,13 +45,13 @@ podman run -d \
**Docker:**
```bash
cd powershell
docker build -t asksage-powershell-proxy .
docker build -t asksage-openai-proxy-powershell .
```

**Podman:**
```bash
cd powershell
podman build -t asksage-powershell-proxy .
podman build -t asksage-openai-proxy-powershell .
```

### Running
Expand All @@ -61,15 +61,15 @@ podman build -t asksage-powershell-proxy .
docker run -d \
-p 8000:8000 \
-e ASKSAGE_API_KEY="your-key-here" \
--name asksage-pwsh-proxy \
asksage-powershell-proxy
--name asksage-openai-proxy-powershell \
asksage-openai-proxy-powershell
```

**Podman:**
```bash
podman run -d \
-p 8000:8000 \
-e ASKSAGE_API_KEY="your-key-here" \
--name asksage-pwsh-proxy \
asksage-powershell-proxy
--name asksage-openai-proxy-powershell \
asksage-openai-proxy-powershell
```
10 changes: 5 additions & 5 deletions powershell/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ RUN wget -q https://github.com/PowerShell/PowerShell/releases/download/v${PS_VER
rm /tmp/powershell.tar.gz

# Create a non-root user
RUN groupadd -g 1000 appuser && \
useradd -u 1000 -g appuser -m -s /bin/bash appuser
RUN groupadd -g 1000 proxy && \
useradd -u 1000 -g proxy -m -s /bin/bash proxy

WORKDIR /app

# Copy application code
COPY AskSageProxy.ps1 /app/AskSageProxy.ps1

# Ensure ownership by appuser
RUN chown -R appuser:appuser /app
# Ensure ownership by proxy
RUN chown -R proxy:proxy /app

# Switch to non-root user
USER appuser
USER proxy

# Expose port
EXPOSE 8000
Expand Down
10 changes: 5 additions & 5 deletions python/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Create a non-root user
RUN groupadd -g 1000 appuser && \
useradd -u 1000 -g appuser -m -s /bin/bash appuser
RUN groupadd -g 1000 proxy && \
useradd -u 1000 -g proxy -m -s /bin/bash proxy

WORKDIR /app

Expand All @@ -29,11 +29,11 @@ RUN python3 -m venv /app/venv && \
# Copy application code
COPY app/ /app/app/

# Ensure ownership by appuser
RUN chown -R appuser:appuser /app
# Ensure ownership by proxy
RUN chown -R proxy:proxy /app

# Switch to non-root user
USER appuser
USER proxy

# Expose port
EXPOSE 8000
Expand Down
2 changes: 1 addition & 1 deletion python/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def lifespan(app: FastAPI):
yield
await app.state.http_client.aclose()

app = FastAPI(title=APP_NAME, version="0.1.0", lifespan=lifespan)
app = FastAPI(title=APP_NAME, version="HEAD", lifespan=lifespan)


@app.get("/healthz")
Expand Down
Loading