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
114 changes: 114 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# ============================================================================
# UPLOAD-MANAGEMENT SYSTEM - ENVIRONMENT VARIABLES
# ============================================================================
# Kopieren Sie diese Datei zu .env und füllen Sie die Werte aus

# ============================================================================
# APP SETTINGS
# ============================================================================
ENVIRONMENT=development
DEBUG=False
APP_NAME="Upload-Management System"
SECRET_KEY=your-super-secret-key-change-in-production

# ============================================================================
# DATABASE
# ============================================================================
DB_USER=upload_user
DB_PASSWORD=your_secure_password_here
DB_NAME=upload_system
DB_HOST=postgres
DB_PORT=5432

# PostgreSQL Connection String (Auto-generated if empty)
# DATABASE_URL=postgresql://upload_user:password@localhost/upload_system

# ============================================================================
# STORAGE
# ============================================================================
STORAGE_TYPE=local
STORAGE_PATH=/var/uploads
MAX_FILE_SIZE_MB=50

# AWS S3 Settings (if using S3 instead of local storage)
# STORAGE_TYPE=s3
# AWS_BUCKET=your-bucket-name
# AWS_REGION=eu-central-1
# AWS_ACCESS_KEY_ID=your_access_key
# AWS_SECRET_ACCESS_KEY=your_secret_key

# ============================================================================
# EMAIL CONFIGURATION
# ============================================================================
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-specific-password
SMTP_FROM_EMAIL=noreply@yourdomain.com
SMTP_FROM_NAME="Upload System"

# Use Gmail example:
# SMTP_USER=your-email@gmail.com
# SMTP_PASSWORD=xxxx xxxx xxxx xxxx (16-character app password)

# Or Strato example:
# SMTP_SERVER=smtp.strato.de
# SMTP_PORT=587
# SMTP_USER=your-email@yourdomain.de
# SMTP_PASSWORD=your-strato-password

# ============================================================================
# CELERY / BACKGROUND TASKS
# ============================================================================
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/1

# ============================================================================
# DOCUMENT SETTINGS
# ============================================================================
DOCUMENT_CONFIG_PATH=/app/config/documents.json
BANK_PROFILES_PATH=/app/config/bank_profiles.json

# Default upload deadline in days
DEFAULT_UPLOAD_DEADLINE_DAYS=30

# Automatically send customer emails?
# If False, admin must approve before customer gets email
ADMIN_APPROVAL_REQUIRED=True
AUTO_SEND_CUSTOMER_EMAILS=False

# ============================================================================
# FEATURE FLAGS
# ============================================================================
FEATURE_OCR=False
FEATURE_DOCUMENT_VERIFICATION=True
FEATURE_MOBILE_APP=False
FEATURE_E_SIGNATURE=False

# ============================================================================
# CORS SETTINGS
# ============================================================================
ALLOWED_ORIGINS=["http://localhost:3000","http://localhost:8000","https://yourdomain.com"]

# ============================================================================
# LOGGING
# ============================================================================
LOG_LEVEL=INFO
LOG_FORMAT=json
LOG_FILE=/var/log/upload_system.log

# ============================================================================
# API KEYS (for Bank integration)
# ============================================================================
BANK_API_KEY_DEUTSCHE_BANK=your_bank_api_key_here
BANK_API_KEY_COMMERZBANK=your_bank_api_key_here

# ============================================================================
# SECURITY
# ============================================================================
# JWT Settings
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_HOURS=24

# CORS
FRONTEND_URL=http://localhost:3000
61 changes: 61 additions & 0 deletions Dockerfile.upload
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Multi-stage build für Upload-Management System

# ============================================================================
# STAGE 1: Backend Builder
# ============================================================================
FROM python:3.11-slim as backend-builder

WORKDIR /build

# Install build dependencies
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY backend/requirements.txt .

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

# ============================================================================
# STAGE 2: Final image
# ============================================================================
FROM python:3.11-slim

WORKDIR /app

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
postgresql-client \
curl \
&& rm -rf /var/lib/apt/lists/*

# Create non-root user
RUN useradd -m -u 1000 appuser

# Copy Python dependencies from builder
COPY --from=backend-builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages

# Copy backend code
COPY backend/ /app/backend/

# Copy config files
COPY config/ /app/config/

# Create upload directory
RUN mkdir -p /var/uploads && chown -R appuser:appuser /var/uploads /app

# Set user
USER appuser

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1

# Expose ports
EXPOSE 8000

# Entrypoint
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
Loading