openclaw/workers/ppal-aws/lambda/discord-handler/Dockerfile
Shunsuke Hayashi ca0e991272 feat(ppal-aws): add Lambda handler for Discord Bot
Add Node.js 22 Lambda function for PPAL Discord Bot:
- Discord Interactions API with Ed25519 signature verification
- Slash commands: /ppal status/help, /miyabi issue/status, /help
- DynamoDB integration for user state management
- Secrets Manager integration for token retrieval
- GitHub API integration for issue creation

Files:
- package.json: Dependencies (aws-sdk v3, discord-api-types, tweetnacl)
- tsconfig.json: TypeScript strict mode, ES2022 target
- Dockerfile: Multi-stage Node.js 22 Alpine build
- src/index.ts: Lambda handler with signature verification
- src/discord/verify.ts: Ed25519 signature validation
- src/discord/commands.ts: Command handlers for /ppal, /miyabi, /help
- src/services/secrets.ts: AWS Secrets Manager client
- src/services/dynamodb.ts: DynamoDB DocumentClient operations

Commands:
- /ppal status: System status with user info
- /ppal help: PPAL commands help
- /miyabi issue <title>: Create GitHub issue
- /miyabi status: Miyabi agent society status
- /help: Full command list

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-25 19:09:12 +09:00

28 lines
449 B
Docker

# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
RUN npm run build
# Production stage
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
COPY --from=builder /app/dist ./dist
# Set non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
USER nodejs
CMD ["node", "dist/index.js"]