This setup provides a complete Docker environment for the Databiologics project with multiple services:
- Database: PostgreSQL 15
- Authentication: Keratin AuthN server
- Backend: Rails API server
- UI Modules: Individual React applications for different user interfaces
- Docker Desktop installed and running
- Docker Compose (included with Docker Desktop)
- Your databiologics-UI and databiologics-api project directories
chmod +x setup.sh
./setup.sh /path/to/databiologics-UI /path/to/databiologics-api
# Start the application (auto-opens browser)
./start.sh
# Stop the application
./stop.sh
Note: After the initial setup, you can use ./start.sh
and ./stop.sh
for daily development. Your project paths are automatically saved and reused.
See QUICK_START.md for detailed usage instructions.
setup.bat C:\path\to\databiologics-UI C:\path\to\databiologics-api
.\setup.ps1 -FrontendPath "C:\path\to\databiologics-UI" -BackendPath "C:\path\to\databiologics-api"
- Validates Prerequisites: Checks if Docker is installed and running
- Validates Paths: Ensures your project directories exist
- Creates Project Structure: Sets up symbolic links or copies to your projects
- Creates Environment File: Copies
env.example
to.env
for configuration - Builds Containers: Creates Docker images for frontend and backend
- Starts Services: Launches all three containers with proper networking
Module | URL | Purpose | Supported User Roles |
---|---|---|---|
Impact Dashboard | http://localhost:3000 | Impact tracking and analytics | ✅ Staff, SuperAdmin, InsightsUser ❌ Patient, AccessUser |
Super Admin | http://localhost:3001 | Administrative interface | ✅ SuperAdmin, Staff ❌ Patient, AccessUser, InsightsUser |
Patient Portal | http://localhost:3002 | Patient portal | ✅ Patient ❌ Staff, SuperAdmin, AccessUser, InsightsUser |
Access Management | http://localhost:3003 | Access management | ✅ AccessUser, Staff, SuperAdmin ❌ Patient, InsightsUser |
Service | URL | Purpose |
---|---|---|
Rails API | http://localhost:21003 | Main application API |
Keratin AuthN (Public) | http://localhost:21001 | Authentication endpoints |
Keratin AuthN (Admin) | http://localhost:21002 | Admin API for user management |
Service | Connection | Purpose |
---|---|---|
PostgreSQL | localhost:5432 | Main application database |
Redis | localhost:6379 | Caching and session storage |
User Type | Password | Role | Access | |
---|---|---|---|---|
Provider | [email protected] | Secret | Staff | All modules except Patient |
Provider | [email protected] | Secret | Staff | All modules except Patient |
Provider | [email protected] | Secret | Staff | All modules except Patient |
Provider | [email protected] | Secret | Staff | All modules except Patient |
Medical Assistant | [email protected] | Secret | Staff | All modules except Patient |
Patient | [email protected] | Secret | Patient | Patient portal only |
Patient | [email protected] | Secret | Patient | Patient portal only |
Patient | [email protected] | Secret | Patient | Patient portal only |
Patient | [email protected] | Secret | Patient | Patient portal only |
Password | Purpose | |
---|---|---|
[email protected] | DataSecret | Development/Testing |
[email protected] | DataSecret | Development/Testing |
[email protected] | DataSecret | Development/Testing |
[email protected] | DataSecret | Development/Testing |
Service | Username | Password | Purpose |
---|---|---|---|
Keratin AuthN Admin | admin | admin123 | User management |
PostgreSQL | data_biologics_dev | dev | Database access |
Development Bypass | - | dataBiologicsDEVteam | API bypass token |
- Image: PostgreSQL 15 Alpine
- Port: 5432
- Database: data_bio_auth_dev
- User: data_biologics_dev
- Password: dev
- Volume: Persistent data storage
- Image: keratin/authn-server:latest
- Ports: 21001 (public), 21002 (admin)
- Purpose: User authentication and session management
- Database: Uses same PostgreSQL instance
- Base: Rails application
- Port: 21003
- Environment: Development mode
- Volume: Your API project directory mounted for live updates
Container | Port | Purpose |
---|---|---|
databiologics-dbio-impact |
3000 | Impact tracking interface |
databiologics-dbio-super-admin |
3001 | Administrative interface |
databiologics-dbio-patient |
3002 | Patient portal |
databiologics-dbio-access |
3003 | Access management interface |
# All services
docker-compose logs -f
# Specific services
docker-compose logs -f dbio-impact
docker-compose logs -f dbio-super-admin
docker-compose logs -f dbio-patient
docker-compose logs -f dbio-access
docker-compose logs -f backend
docker-compose logs -f keratin_auth
docker-compose logs -f db
# Stop all services
docker-compose down
# Start specific UI module
docker-compose up -d dbio-super-admin
# Restart a specific service
docker-compose restart dbio-impact
# Rebuild and restart all
docker-compose up --build
# Access container shell
docker-compose exec dbio-super-admin sh
docker-compose exec backend sh
docker-compose exec keratin_auth sh
docker-compose exec db psql -U data_biologics_dev -d data_bio_auth_dev
# Connect to main application database
docker-compose exec db psql -U data_biologics_dev -d dbio_primary_dev
# Connect to authentication database
docker-compose exec db psql -U data_biologics_dev -d data_bio_auth_dev
# Backup main database
docker-compose exec db pg_dump -U data_biologics_dev dbio_primary_dev > backup.sql
# Backup auth database
docker-compose exec db pg_dump -U data_biologics_dev data_bio_auth_dev > auth_backup.sql
# Restore database
docker-compose exec -T db psql -U data_biologics_dev -d dbio_primary_dev < backup.sql
The setup creates a .env
file with default configuration. You can modify this file to change:
- Database credentials
- API URLs
- Port numbers
- Environment variables
-
Port Already in Use
- Stop other services using ports 3000, 3001, or 5432
- Or modify the ports in
docker-compose.yml
-
Permission Denied (Linux/macOS)
- Make sure the script is executable:
chmod +x setup.sh
- Make sure the script is executable:
-
Docker Not Running
- Start Docker Desktop
- Wait for it to fully initialize
-
Build Failures
- Check that your project directories contain valid
package.json
files - Ensure all dependencies are properly defined
- Check that your project directories contain valid
-
Container Won't Start
- Check logs:
docker-compose logs [service_name]
- Verify your project structure and dependencies
- Check logs:
# Stop and remove all containers, networks, and volumes
docker-compose down -v --remove-orphans
# Remove all images
docker-compose down --rmi all
# Start fresh
./setup.sh /path/to/databiologics-UI /path/to/databiologics-api
- Code Changes: Your local files are mounted into containers, so changes are reflected immediately
- Dependencies: If you add new dependencies, rebuild the containers:
docker-compose up --build
- Database Changes: The database persists between restarts, but you can reset it by removing the volume
databiologics-docker-setup/
├── docker-compose.yml # Main Docker Compose configuration
├── databiologics-UI/ # Symlink to your UI project
├── databiologics-api/ # Symlink to your API project
├── init-db/ # Database initialization scripts
│ └── 01-init.sql
├── setup.sh # macOS/Linux setup script
├── setup.bat # Windows batch setup script
├── setup.ps1 # Windows PowerShell setup script
├── env.example # Environment configuration template
└── README.md # This file
If you encounter issues:
- Check the troubleshooting section above
- Review Docker and Docker Compose logs
- Ensure your project directories have the correct structure
- Verify all prerequisites are met