Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Multi-stage Dockerfile for ECS Deployment
# Auto-generated by Repository Readiness Analyzer

# Build stage
FROM python:3.11-slim AS builder

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Runtime stage
FROM python:3.11-slim

WORKDIR /app

# Copy installed dependencies from builder
COPY --from=builder /root/.local /root/.local

# Copy application code
COPY . .

# Create non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app

# Switch to non-root user
USER appuser

# Make sure scripts in .local are usable
ENV PATH=/root/.local/bin:$PATH

# Expose port (adjust as needed)
EXPOSE 8080

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:8080/health', timeout=2)" || exit 1

# Run application (adjust CMD to your entry point)
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
20 changes: 20 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SonarQube Configuration for Node.js Projects
# Auto-generated by Repository Readiness Analyzer

sonar.projectKey={{PROJECT_KEY}}
sonar.projectName={{PROJECT_NAME}}
sonar.projectVersion=1.0

# Source code directory
sonar.sources=src
sonar.sourceEncoding=UTF-8

# JavaScript/TypeScript settings
sonar.javascript.lcov.reportPaths=coverage/lcov.info

# Exclude common directories
sonar.exclusions=**/node_modules/**,**/dist/**,**/build/**,**/coverage/**,**/.git/**,**/tests/**,**/*.spec.js,**/*.test.js

# Test files
sonar.tests=tests,src/**/*.test.js,src/**/*.spec.js
sonar.test.inclusions=**/*.test.js,**/*.spec.js