synor/apps/api-gateway/Dockerfile
Gulshan Yadav 4a2825f516 feat(api): add public API gateway with rate limiting
- Create API gateway service with Express.js
- Implement sliding window rate limiting via Redis
- Add API key management with tiered access (free/developer/enterprise)
- Track usage analytics per key and globally
- Add RPC proxy to blockchain nodes
- Configure Docker Compose with api-gateway and redis services
- Free tier: 100 req/min, Developer: 1000 req/min, Enterprise: unlimited
2026-01-10 06:19:08 +05:30

35 lines
529 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies
COPY package.json ./
RUN npm install
# Build TypeScript
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Copy package files
COPY package.json ./
# Install production dependencies only
RUN npm install --production
# Copy built files
COPY --from=builder /app/dist ./dist
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3100
EXPOSE 3100
CMD ["node", "dist/index.js"]