2.9 KiB
2.9 KiB
ShiftScheduler Docker Setup
This directory contains Docker configuration files for running the ShiftScheduler application in containers.
Files
Dockerfile- Main production dockerfile that uses local source files (recommended)Dockerfile.production- Alternative dockerfile that attempts to clone from GitHub repositoryDockerfile.local- Development dockerfile that uses local source filesdocker-compose.yml- Docker Compose configuration for easy deployment.dockerignore- Files to exclude from Docker build context
Usage
Option 1: Using Local Source (Recommended)
# Build using local source files - most reliable approach
docker build -t shiftscheduler:latest .
# Run the container
docker run -p 5000:5000 shiftscheduler:latest
Option 2: Using Docker Compose (Easiest)
# Start the application
docker-compose up --build
# Run in background
docker-compose up -d --build
# Stop the application
docker-compose down
Option 3: Development Build
# Build for development
docker build -f Dockerfile.local -t shiftscheduler:dev .
# Run the container
docker run -p 5000:5000 shiftscheduler:dev
Option 4: Git Repository Clone (May Fail in Restricted Environments)
# Build using git repository clone - may fail due to auth/SSL issues
docker build -f Dockerfile.production -t shiftscheduler:production .
# Run the container
docker run -p 5000:5000 shiftscheduler:production
Accessing the Application
Once running, the application will be available at:
Notes
- Main Dockerfile: Uses local source files for maximum reliability
- Dockerfile.production: Attempts to clone from GitHub but may fail in restricted environments
- Dockerfile.local: Same as main Dockerfile but with explicit naming for development
- The application runs on port 5000 inside the container
- Environment is set to Production by default in Docker containers
Troubleshooting
Git Clone Authentication Issues
If you encounter errors like:
fatal: could not read Username for 'https://github.com': No such device or address
This is common in Docker build environments with:
- Network restrictions
- SSL certificate verification issues
- Missing authentication credentials
Solutions:
- Use the main Dockerfile instead:
docker build -t shiftscheduler . - Use Docker Compose:
docker-compose up --build - Build with local files:
docker build -f Dockerfile.local -t shiftscheduler .
SSL Certificate Issues
If you encounter SSL certificate errors:
- Use the local source approach:
docker build -t shiftscheduler . - Use Docker Compose:
docker-compose up --build - Build with network host mode:
docker build --network=host -t shiftscheduler .
General Docker Issues
- Ensure no other service is using port 5000
- For development, use
docker build -f Dockerfile.local -t shiftscheduler . - Check Docker daemon is running and accessible