Skip to content

Commit 71d8cb0

Browse files
Merge pull request #49 from YellowscorpionDPIII/copilot/enhance-deployability-features
Add production-grade features: secrets management, structured logging, shutdown handling, and K8s support
2 parents a90bfbb + fe5ceea commit 71d8cb0

17 files changed

+2779
-0
lines changed

.dockerignore

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.github
5+
6+
# Python
7+
__pycache__
8+
*.py[cod]
9+
*$py.class
10+
*.so
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# Virtual environments
30+
venv/
31+
ENV/
32+
env/
33+
34+
# IDE
35+
.vscode/
36+
.idea/
37+
*.swp
38+
*.swo
39+
*~
40+
41+
# Testing
42+
.pytest_cache/
43+
.coverage
44+
htmlcov/
45+
.tox/
46+
47+
# Documentation
48+
docs/_build/
49+
50+
# OS
51+
.DS_Store
52+
Thumbs.db
53+
54+
# Temporary files
55+
*.log
56+
tmp/
57+
temp/
58+
/tmp/
59+
60+
# Examples and tests (optional - uncomment if you don't want them in the image)
61+
# examples/
62+
# mira/tests/
63+
64+
# Pull request comments
65+
pull_request_comments/
66+
67+
# Config examples
68+
config.example.json

Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Production-ready Dockerfile for Mira platform
2+
FROM python:3.11-slim
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Set environment variables
8+
ENV PYTHONUNBUFFERED=1 \
9+
PYTHONDONTWRITEBYTECODE=1 \
10+
PIP_NO_CACHE_DIR=1 \
11+
PIP_DISABLE_PIP_VERSION_CHECK=1
12+
13+
# Install system dependencies
14+
RUN apt-get update && apt-get install -y --no-install-recommends \
15+
gcc \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Copy requirements first for better caching
19+
COPY requirements.txt setup.py README.md ./
20+
COPY mira/__init__.py mira/__init__.py
21+
22+
# Install Python dependencies
23+
RUN pip install --no-cache-dir -r requirements.txt
24+
25+
# Install package in editable mode
26+
RUN pip install -e .
27+
28+
# Copy application code
29+
COPY . .
30+
31+
# Create non-root user for security
32+
RUN useradd -m -u 1000 mira && \
33+
chown -R mira:mira /app
34+
35+
USER mira
36+
37+
# Expose webhook port
38+
EXPOSE 5000
39+
40+
# Health check
41+
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
42+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/healthz')" || exit 1
43+
44+
# Run the application
45+
CMD ["python", "-m", "mira.app"]

0 commit comments

Comments
 (0)