This repository contains deployment configurations and scripts for the Digital Medical Records (DMR) system, a web-based simulation platform for medical education at UWA.
We provide two comprehensive deployment guides:
Recommended for most users - Deploy with a single command using the deploy.sh script.
- Automatic update checking for backend and frontend
- One-command deployment and updates
- Built-in database migrations
- Detailed troubleshooting guide
Quick start:
cp dmrserver.env.example dmrserver.env
nano dmrserver.env # Edit settings as needed
chmod +x deploy.sh
./deploy.shFor developers and custom setups - Full control over the deployment process.
- Step-by-step backend deployment instructions
- Two frontend deployment options:
- Download pre-built releases
- Build from source with npm
- Comprehensive configuration guide
- Production deployment checklist
- Docker Desktop (version 20.10+)
- Docker Compose (version 2.0+)
- Git (version 2.20+)
- wget (for frontend downloads)
See the documentation guides for detailed requirements.
-
Clone this repository:
git clone https://github.com/UWA-CITS5206-DMR/deploy cd deploy -
Configure environment:
cp dmrserver.env.example dmrserver.env nano dmrserver.env # Edit settings as needed -
Run deployment:
chmod +x deploy.sh ./deploy.sh
The script will automatically:
- Clone the backend repository (first time only)
- Download the latest frontend release
- Build and start Docker containers
- Run database migrations
- Verify everything is running
-
Access the application: http://localhost:8000
deploy.sh- Automated deployment scriptcompose.yaml- Docker service definitionsdmrserver.env.example- Django environment configuration templatedmrserver.env- Your environment configuration (created from .example)nginx/- Web server and reverse proxy configurationreact/dist/- Frontend build output directory
The deploy.sh script supports multiple commands for different scenarios:
# Check for updates and deploy if available (default)
./deploy.sh
./deploy.sh update
# Force rebuild without checking for updates
./deploy.sh build
# Complete clean rebuild (removes containers and images)
./deploy.sh rebuild
# Check current deployment status
./deploy.sh status
# Show help
./deploy.sh help--force- Skip confirmation prompts--skip-migrations- Skip running database migrations
Examples:
# Force complete rebuild
./deploy.sh rebuild --force
# Build without running migrations
./deploy.sh build --skip-migrations./deploy.sh updateThe script automatically checks both repositories for updates.
# All services
docker compose logs
# Backend only
docker logs dmrserver
# Nginx only
docker logs nginxdocker compose restartdocker compose downFor detailed troubleshooting, see the comprehensive TROUBLESHOOTING.md guide.
Common quick fixes:
# Use rebuild command for clean start
./deploy.sh rebuild --force
# Run migrations manually
docker exec dmrserver uv run python manage.py migrate
# Collect static files
docker exec dmrserver uv run python manage.py collectstatic --noinput
# Check status
./deploy.sh statusFor production environments:
-
Copy and configure environment:
cp dmrserver.env.example dmrserver.env nano dmrserver.env
-
Update security settings in
dmrserver.env:- Set
DEBUG=False - Change
SECRET_KEYto a secure random value - Restrict
ALLOWED_HOSTSto your domain - Add
CSRF_TRUSTED_ORIGINSwith your domain - Configure CORS properly
- Set
-
Use HTTPS - Configure SSL certificates and update nginx configuration
-
Set up backups - Regularly backup
dmrserver/data/directory -
Monitor logs - Check
log/nginx/for access and error logs
- Automated Deployment Issues: See AUTOMATED_DEPLOYMENT.md
- Manual Deployment Issues: See MANUAL_DEPLOYMENT.md
- Backend Issues: https://github.com/UWA-CITS5206-DMR/dmrserver
- Frontend Issues: https://github.com/UWA-CITS5206-DMR/react-ui
- Backend: https://github.com/UWA-CITS5206-DMR/dmrserver
- Frontend: https://github.com/UWA-CITS5206-DMR/react-ui
Quick Links: Automated Guide | Manual Guide | Backend Repo | Frontend Repo