Add production deployment configurations and guides

Deployment options:
- Railway cloud deployment (recommended, 5-min setup)
- Render alternative deployment
- Docker Compose for VPS deployment
- Comprehensive environment variable documentation

Includes:
- Production-grade Dockerfile with multi-stage builds
- Docker Compose configuration for production
- Detailed deployment guide with troubleshooting
- Backup and recovery procedures
- Monitoring and scaling recommendations

Deployment paths ready:
 Railway (railway.app)
 Render (render.com)
 Self-hosted VPS (DigitalOcean, Linode, etc.)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
drjones
2026-07-07 05:17:03 +00:00
parent 989c00e5fb
commit 9841ff99bb
4 changed files with 350 additions and 9 deletions

32
Dockerfile.prod Normal file
View File

@@ -0,0 +1,32 @@
# Build stage - backend
FROM python:3.10-slim as backend-builder
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Runtime stage - backend
FROM python:3.10-slim as backend
WORKDIR /app
COPY --from=backend-builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY backend /app
ENV PYTHONUNBUFFERED=1
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
# Frontend build
FROM node:22-alpine as frontend-builder
WORKDIR /app
COPY frontend/package*.json ./
RUN npm ci
COPY frontend .
RUN npm run build
# Frontend runtime
FROM node:22-alpine as frontend
WORKDIR /app
COPY --from=frontend-builder /app/.next ./.next
COPY --from=frontend-builder /app/node_modules ./node_modules
COPY --from=frontend-builder /app/package*.json ./
COPY frontend/public ./public
EXPOSE 3000
CMD ["npm", "start"]