Spaces:
Running
Running
Commit
·
660e83c
1
Parent(s):
1b6761e
Fixed the permission issues
Browse files- Dockerfile +12 -4
- examples/voice_agent_webrtc_langgraph/start.sh +5 -0
Dockerfile
CHANGED
|
@@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 20 |
libgl1 \
|
| 21 |
libglx-mesa0 \
|
| 22 |
curl \
|
|
|
|
| 23 |
ffmpeg \
|
| 24 |
git \
|
| 25 |
net-tools \
|
|
@@ -29,18 +30,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 29 |
&& rm -rf /var/lib/apt/lists/* \
|
| 30 |
&& pip install --no-cache-dir --upgrade pip uv
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# App directory setup
|
| 33 |
WORKDIR /app
|
| 34 |
|
| 35 |
# App files
|
| 36 |
-
COPY pyproject.toml uv.lock \
|
| 37 |
LICENSE README.md NVIDIA_PIPECAT.md \
|
| 38 |
./
|
| 39 |
-
COPY src/ ./src/
|
| 40 |
-
COPY examples/voice_agent_webrtc_langgraph/ ./examples/voice_agent_webrtc_langgraph/
|
| 41 |
|
| 42 |
# Copy built UI into example directory so FastAPI can serve it
|
| 43 |
-
COPY --from=ui-builder /ui/dist /app/examples/voice_agent_webrtc_langgraph/ui/dist
|
| 44 |
|
| 45 |
# Example app directory
|
| 46 |
WORKDIR /app/examples/voice_agent_webrtc_langgraph
|
|
|
|
| 20 |
libgl1 \
|
| 21 |
libglx-mesa0 \
|
| 22 |
curl \
|
| 23 |
+
ca-certificates \
|
| 24 |
ffmpeg \
|
| 25 |
git \
|
| 26 |
net-tools \
|
|
|
|
| 30 |
&& rm -rf /var/lib/apt/lists/* \
|
| 31 |
&& pip install --no-cache-dir --upgrade pip uv
|
| 32 |
|
| 33 |
+
# Create non-root user (UID 1000) for provider runtime
|
| 34 |
+
RUN useradd -m -u 1000 user
|
| 35 |
+
ENV HOME=/home/user
|
| 36 |
+
ENV PATH=$HOME/.local/bin:$PATH
|
| 37 |
+
ENV XDG_CACHE_HOME=$HOME/.cache
|
| 38 |
+
USER user
|
| 39 |
+
|
| 40 |
# App directory setup
|
| 41 |
WORKDIR /app
|
| 42 |
|
| 43 |
# App files
|
| 44 |
+
COPY --chown=user pyproject.toml uv.lock \
|
| 45 |
LICENSE README.md NVIDIA_PIPECAT.md \
|
| 46 |
./
|
| 47 |
+
COPY --chown=user src/ ./src/
|
| 48 |
+
COPY --chown=user examples/voice_agent_webrtc_langgraph/ ./examples/voice_agent_webrtc_langgraph/
|
| 49 |
|
| 50 |
# Copy built UI into example directory so FastAPI can serve it
|
| 51 |
+
COPY --from=ui-builder --chown=user /ui/dist /app/examples/voice_agent_webrtc_langgraph/ui/dist
|
| 52 |
|
| 53 |
# Example app directory
|
| 54 |
WORKDIR /app/examples/voice_agent_webrtc_langgraph
|
examples/voice_agent_webrtc_langgraph/start.sh
CHANGED
|
@@ -11,6 +11,11 @@ fi
|
|
| 11 |
|
| 12 |
# If a remote prompt URL is provided, download it and export ZERO_SHOT_AUDIO_PROMPT
|
| 13 |
if [ -n "${ZERO_SHOT_AUDIO_PROMPT_URL:-}" ]; then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
PROMPT_TARGET="${ZERO_SHOT_AUDIO_PROMPT:-/app/examples/voice_agent_webrtc_langgraph/audio_prompt.wav}"
|
| 15 |
mkdir -p "$(dirname "$PROMPT_TARGET")"
|
| 16 |
if [ ! -f "$PROMPT_TARGET" ]; then
|
|
|
|
| 11 |
|
| 12 |
# If a remote prompt URL is provided, download it and export ZERO_SHOT_AUDIO_PROMPT
|
| 13 |
if [ -n "${ZERO_SHOT_AUDIO_PROMPT_URL:-}" ]; then
|
| 14 |
+
case "$ZERO_SHOT_AUDIO_PROMPT_URL" in
|
| 15 |
+
*"github.com"*"/blob"*)
|
| 16 |
+
ZERO_SHOT_AUDIO_PROMPT_URL="${ZERO_SHOT_AUDIO_PROMPT_URL}?raw=1"
|
| 17 |
+
;;
|
| 18 |
+
esac
|
| 19 |
PROMPT_TARGET="${ZERO_SHOT_AUDIO_PROMPT:-/app/examples/voice_agent_webrtc_langgraph/audio_prompt.wav}"
|
| 20 |
mkdir -p "$(dirname "$PROMPT_TARGET")"
|
| 21 |
if [ ! -f "$PROMPT_TARGET" ]; then
|