Skip to content

Latest commit

 

History

History
74 lines (57 loc) · 1.73 KB

File metadata and controls

74 lines (57 loc) · 1.73 KB

Docker Setup Complete ✅

What's Been Configured

Dockerfile - Production-ready Docker configuration
.dockerignore - Optimized Docker builds
.env file - Environment variables (gitignored)
venv/ - Virtual environment (gitignored)
railway.json - Updated to use Dockerfile
Procfile - Removed (using Dockerfile instead)
.gitignore - Updated to exclude venv/ and .env

Docker Configuration

Dockerfile

  • Uses Python 3.11 slim image
  • Installs all dependencies from requirements.txt
  • Exposes port 8000 (Railway will override with $PORT)
  • Runs uvicorn server

.dockerignore

Excludes unnecessary files from Docker build:

  • Git files
  • Virtual environment
  • Environment files
  • IDE files
  • Test files

Railway Deployment

Railway will:

  1. Detect Dockerfile automatically
  2. Build Docker image
  3. Run container with environment variables
  4. Expose on Railway's domain

Environment Variables

Set these in Railway dashboard:

  • OPENAI_API_KEY (required)
  • DEFAULT_HOURLY_RATE (optional)
  • BUFFER_PERCENTAGE (optional)
  • OPENAI_MODEL (optional)

Local Docker Testing

# Build image
docker build -t estimation-bot .

# Run container
docker run -p 8000:8000 --env-file .env estimation-bot

# Or with environment variables directly
docker run -p 8000:8000 -e OPENAI_API_KEY=your_key estimation-bot

GitHub Deployment

  1. Push code to GitHub
  2. Connect Railway to GitHub repo
  3. Railway detects Dockerfile
  4. Set environment variables
  5. Deploy!

Verification

All files are properly configured:

  • ✅ Dockerfile exists
  • ✅ .dockerignore exists
  • ✅ .env exists (gitignored)
  • ✅ venv/ exists (gitignored)
  • ✅ Procfile removed
  • ✅ railway.json uses Dockerfile