Step 2: Add Users microservice with API Gateway routing
- Created Users service with full CRUD operations - Updated Console to act as API Gateway for Users service - Implemented service-to-service communication - Added service health monitoring in Console - Docker Compose now manages both services Services running: - Console (API Gateway): http://localhost:8011 - Users service: Internal network only Test endpoints: - Status: curl http://localhost:8011/api/status - Users: curl http://localhost:8011/api/users/users 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
21
services/users/backend/Dockerfile
Normal file
21
services/users/backend/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements first for better caching
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the application
|
||||
CMD ["python", "main.py"]
|
||||
Reference in New Issue
Block a user