Skip to content
Merged
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
34 changes: 29 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
# Security Configuration
SECRET_KEY=your-secret-key-change-this-to-a-random-string-in-production
ENVIRONMENT=development

# CORS Configuration (comma-separated origins)
ALLOWED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
# Minimum 32 characters. Generate with: python -c "import secrets; print(secrets.token_urlsafe(48))"
SECRET_KEY=replace-me-with-a-long-random-string-at-least-32-chars

# Database Configuration
DATABASE_URL=sqlite:///./auth.db
# DATABASE_URL=postgresql+psycopg://app:app@localhost:5432/app

ALLOWED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000

ACCESS_TOKEN_MINUTES=15
REFRESH_TOKEN_DAYS=14

LOGIN_RATE_LIMIT=5/minute
SIGNUP_RATE_LIMIT=3/minute

LOCKOUT_THRESHOLD=5
LOCKOUT_MINUTES=15

# Set to true behind HTTPS in production.
COOKIE_SECURE=false

TOTP_ISSUER=Cipher

# ── Email (set EMAIL_ENABLED=true to send real verification / reset emails) ──
EMAIL_ENABLED=false
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=user@example.com
SMTP_PASSWORD=your-smtp-password
SMTP_FROM=noreply@cipher.app
APP_BASE_URL=http://localhost:8000
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM python:3.12-slim AS base

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libpq-dev \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt

COPY backend ./backend
COPY frontend ./frontend
COPY alembic ./alembic
COPY alembic.ini ./

RUN useradd --create-home --uid 1000 app && chown -R app:app /app
USER app

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