Use Docker for local development environment
- Update README and CLAUDE.md with Docker-based dev workflow - Add Dockerfile for containerized deployment - Add gunicorn to requirements.txt - Dev uses volume mount for live code reloading Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements first for better caching
|
||||
COPY src/requirements.txt .
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY src/ .
|
||||
|
||||
# Create non-root user for security
|
||||
RUN useradd --create-home appuser && chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
# Default to production; override with --env-file at runtime
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:create_app()"]
|
||||
Reference in New Issue
Block a user