Skip to content

Commit f0bd4f2

Browse files
committed
fix: single-token entrypoint scripts for containers (Render dockerCommand quoting)
1 parent bcfffc4 commit f0bd4f2

5 files changed

Lines changed: 23 additions & 7 deletions

File tree

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ COPY agentwatch ./agentwatch
88
COPY dashboard ./dashboard
99
COPY migrations ./migrations
1010
COPY alembic.ini ./
11+
COPY scripts ./scripts
1112

12-
RUN pip install --upgrade pip && pip install ".[dashboard]"
13+
RUN pip install --upgrade pip && pip install ".[dashboard]" && chmod +x scripts/*.sh
1314

14-
# Default command is the API; compose overrides the command per service.
15-
CMD ["agentwatch", "serve", "--host", "0.0.0.0", "--port", "8000"]
15+
# Default command is the API entrypoint (migrate + serve). Compose / Render override
16+
# with a single-token script path per service so no shell quoting is involved.
17+
CMD ["/app/scripts/render-api.sh"]

deploy/docker-compose.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ services:
1818

1919
api:
2020
build: ..
21-
command: sh -c "alembic upgrade head && agentwatch serve --host 0.0.0.0 --port 8000"
21+
command: ["/app/scripts/render-api.sh"]
2222
environment:
2323
AGENTWATCH_DATABASE_URL: postgresql+psycopg://agentwatch:agentwatch@db:5432/agentwatch
2424
AGENTWATCH_ARTIFACT_DIR: /data/artifacts
25+
PORT: "8000"
2526
volumes:
2627
- artifacts:/data/artifacts
2728
depends_on:
@@ -30,9 +31,10 @@ services:
3031

3132
dashboard:
3233
build: ..
33-
command: streamlit run dashboard/app.py --server.port 8501 --server.address 0.0.0.0
34+
command: ["/app/scripts/render-dashboard.sh"]
3435
environment:
3536
AGENTWATCH_API_URL: http://api:8000
37+
PORT: "8501"
3638
depends_on:
3739
- api
3840

render.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
dockerfilePath: ./Dockerfile
1212
dockerContext: .
1313
plan: free
14-
dockerCommand: sh -c "alembic upgrade head && agentwatch serve --host 0.0.0.0 --port $PORT"
14+
dockerCommand: /app/scripts/render-api.sh
1515
envVars:
1616
- key: AGENTWATCH_DATABASE_URL
1717
fromDatabase:
@@ -26,7 +26,7 @@ services:
2626
dockerfilePath: ./Dockerfile
2727
dockerContext: .
2828
plan: free
29-
dockerCommand: sh -c "streamlit run dashboard/app.py --server.port $PORT --server.address 0.0.0.0"
29+
dockerCommand: /app/scripts/render-dashboard.sh
3030
envVars:
3131
- key: AGENTWATCH_API_URL
3232
fromService:

scripts/render-api.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
# API entrypoint: apply migrations, then serve. Runs migrations idempotently on boot.
3+
set -e
4+
alembic upgrade head
5+
exec agentwatch serve --host 0.0.0.0 --port "${PORT:-8000}"

scripts/render-dashboard.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# Dashboard entrypoint: run the Streamlit app.
3+
set -e
4+
exec streamlit run dashboard/app.py \
5+
--server.port "${PORT:-8501}" \
6+
--server.address 0.0.0.0 \
7+
--server.headless true

0 commit comments

Comments
 (0)