chore: add docker infrastructure, gists feature, attachment system, and admin CLI tools

- Add .dockerignore, Dockerfile, and docker compose targets to Makefile for containerized deployment
- Implement gists router with CRUD operations, database schema, and polymorphic comment/vote reuse
- Create attachment upload system with thumbnail generation, MIME detection, and storage path management
- Add attachments_prune CLI command to clean orphaned attachment records and files
- Introduce rate limiting middleware with 60 requests per minute window
- Add custom 404 and 500 error handlers with SEO-optimized template responses
- Extend database initialization with gists and attachments indexes plus upload site settings defaults
- Update load_comments to include attachment mapping for comment resources
- Register gists and uploads routers in main application and update AGENTS.md documentation
This commit is contained in:
2026-05-12 13:07:34 +00:00
parent ff2585b098
commit aa88f18c03
69 changed files with 3069 additions and 450 deletions
+51
View File
@@ -0,0 +1,51 @@
name: devplace
services:
app:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- .env
environment:
DEVPLACE_DATABASE_URL: sqlite:///data/devplace.db
volumes:
- devplace_data:/app/data
- devplace_uploads:/app/devplacepy/static/uploads
expose:
- "10500"
networks:
- appnet
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:10500/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
restart: unless-stopped
ports:
- "${PORT:-80}:80"
environment:
NGINX_CACHE_ENABLED: "${NGINX_CACHE_ENABLED:-false}"
NGINX_CACHE_MAX_SIZE: "${NGINX_CACHE_MAX_SIZE:-1g}"
volumes:
- devplace_uploads:/app/static/uploads:ro
depends_on:
app:
condition: service_healthy
networks:
- appnet
volumes:
devplace_data:
devplace_uploads:
networks:
appnet:
driver: bridge