feat: production deployment setup and hardcoded URL fixes
- Fix hardcoded localhost:8000 URLs in frontend to use relative /api/v1 path (works with Nginx proxy in prod and VITE_API_URL in dev) - Create production entrypoint (entrypoint.prod.sh) that runs migrations, seeds, and starts uvicorn with 4 workers (no --reload) - Create comprehensive install.sh script for production deployment that generates secure .env, builds containers, waits for health, and optionally triggers initial MITRE sync - Update docker-compose.prod.yml to use production entrypoint - Update Dockerfile to make both entrypoints executable - Remove init.ps1 (production will always be Linux) - Update README with production deployment instructions
This commit is contained in:
@@ -16,8 +16,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Make entrypoint executable
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
# Make entrypoints executable
|
||||
RUN chmod +x /app/entrypoint.sh /app/entrypoint.prod.sh
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
14
backend/entrypoint.prod.sh
Normal file
14
backend/entrypoint.prod.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "=== [PROD] Running Alembic migrations ==="
|
||||
alembic upgrade head
|
||||
|
||||
echo "=== [PROD] Seeding admin user ==="
|
||||
python -m app.seed
|
||||
|
||||
echo "=== [PROD] Seeding data sources ==="
|
||||
python -m app.seed_data_sources
|
||||
|
||||
echo "=== [PROD] Starting uvicorn (production) ==="
|
||||
exec uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
|
||||
Reference in New Issue
Block a user