Skip to content

Commit c4f9a1d

Browse files
committed
feat: add ping router
2 parents 6b18c67 + 4fcebad commit c4f9a1d

File tree

8 files changed

+3326
-0
lines changed

8 files changed

+3326
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Deepseek API Key (required)
2+
DEEPSEEK_API_KEY=your-deepseek-api-key-here
3+
4+
# Server configuration (optional)
5+
PORT=8080
6+
HOST=0.0.0.0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
.env
4+
*.log
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Multi-stage build for ARM64 (AWS Bedrock requirement)
2+
# MUST build from astack root directory:
3+
# cd /Users/archer/a-github/astack && docker build --platform linux/arm64 -f examples/agent-in-aws-bedrock-agent-core/Dockerfile -t IMAGE_NAME .
4+
5+
FROM node:18-alpine AS builder
6+
7+
WORKDIR /app
8+
9+
# Copy workspace files from root
10+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json tsconfig.json ./
11+
COPY packages ./packages
12+
COPY examples/agent-in-aws-bedrock-agent-core ./examples/agent-in-aws-bedrock-agent-core
13+
14+
# Install pnpm and dependencies
15+
RUN corepack enable pnpm && \
16+
pnpm install --frozen-lockfile --registry=https://registry.npmmirror.com
17+
18+
# Build all packages then the example
19+
RUN pnpm build && \
20+
cd examples/agent-in-aws-bedrock-agent-core && \
21+
pnpm build
22+
23+
# Production stage
24+
FROM node:18-alpine
25+
26+
WORKDIR /app
27+
28+
# Copy workspace structure to maintain proper module resolution
29+
COPY --from=builder /app/package.json /app/pnpm-lock.yaml /app/pnpm-workspace.yaml ./
30+
COPY --from=builder /app/node_modules ./node_modules
31+
COPY --from=builder /app/packages ./packages
32+
COPY --from=builder /app/examples/agent-in-aws-bedrock-agent-core ./examples/agent-in-aws-bedrock-agent-core
33+
34+
# Set working directory to the example
35+
WORKDIR /app/examples/agent-in-aws-bedrock-agent-core
36+
37+
# Expose port 8080
38+
EXPOSE 8080
39+
40+
# Environment variables
41+
ENV NODE_ENV=production
42+
ENV PORT=8080
43+
ENV HOST=0.0.0.0
44+
45+
# Health check
46+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
47+
CMD node -e "require('http').get('http://localhost:8080/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
48+
49+
# Run server
50+
CMD ["node", "dist/server.js"]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "agent-in-aws-bedrock-agent-core",
3+
"version": "1.0.0",
4+
"description": "Minimal AStack agent runtime for AWS Bedrock AgentCore",
5+
"type": "module",
6+
"main": "dist/server.js",
7+
"scripts": {
8+
"build": "tsc",
9+
"start": "node dist/server.js",
10+
"dev": "tsx watch src/server.ts",
11+
"check-types": "tsc --noEmit"
12+
},
13+
"dependencies": {
14+
"@astack-tech/components": "workspace:*",
15+
"@astack-tech/core": "workspace:*",
16+
"@astack-tech/integrations": "workspace:*",
17+
"@astack-tech/tools": "workspace:*",
18+
"@hono/node-server": "^1.13.7",
19+
"dotenv": "^17.2.2",
20+
"hono": "^4.6.14"
21+
},
22+
"devDependencies": {
23+
"@types/node": "^22.0.0",
24+
"tsx": "^4.19.0",
25+
"typescript": "^5.6.0"
26+
}
27+
}

0 commit comments

Comments
 (0)