Skip to content

Commit 0eef212

Browse files
committed
update
1 parent 28f3160 commit 0eef212

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pkg/agentfs/examples/node.Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ RUN pnpm install --frozen-lockfile
3636
COPY . .
3737

3838
# Build the project
39-
RUN pnpm exec tsc
39+
# Your package.json must contain a "build" script, such as `"build": "tsc"`
40+
RUN pnpm build
4041

4142
# Create a non-privileged user that the app will run under
4243
# See https://docs.docker.com/develop/develop-images/dockerfile_best_practices/#user
@@ -49,16 +50,17 @@ RUN adduser \
4950
--uid "${UID}" \
5051
appuser
5152

52-
# Ensure ownership of app files and drop privileges for better security
53+
# Set proper permissions
5354
RUN chown -R appuser:appuser /app
5455
USER appuser
5556

5657
# Pre-download any ML models or files the agent needs
5758
# This ensures the container is ready to run immediately without downloading
5859
# dependencies at runtime, which improves startup time and reliability
59-
RUN pnpm exec node dist/agent.js download-files
60+
# Your package.json must contain a "download-files" script, such as `"download-files": "pnpm run build && node dist/agent.js download-files"`
61+
RUN pnpm download-files
6062

61-
# Remove development-only dependencies to reduce the runtime image size
63+
# Switch back to root to remove dev dependencies and finalize setup
6264
USER root
6365
RUN pnpm prune --prod && chown -R appuser:appuser /app
6466
USER appuser
@@ -68,4 +70,5 @@ ENV NODE_ENV=production
6870

6971
# Run the application
7072
# The "start" command tells the worker to connect to LiveKit and begin waiting for jobs.
71-
CMD [ "pnpm", "exec", "node", "dist/agent.js", "start" ]
73+
# Your package.json must contain a "start" script, such as `"start": "node dist/agent.js start"`
74+
CMD [ "pnpm", "start" ]

0 commit comments

Comments
 (0)