A reference implementation of a mobile application using Ionic Angular and containerized infrastructure. This project demonstrates best practices for mobile app development with a focus on automated builds and deployments.
- Ionic Angular: Built with the latest Ionic and Angular frameworks
- Docker Integration: Complete containerized development environment
- CI/CD Pipeline: Automated build and deployment with Fastlane
- Best Practices: Following industry best practices for mobile development
- Documentation: Comprehensive documentation for reference
- Docker & Docker Compose
- Node.js (for development outside Docker)
- Xcode (for iOS final builds)
- Android Studio (optional, for Android development outside Docker)
To start the development environment:
docker-compose up -dThis will start the Ionic development server on port 8100. Access it at http://localhost:8100
To build Android APK:
docker-compose exec android-builder bash -c "cd /app && fastlane android debug"If you prefer to develop locally:
npm install
ionic serveThe project follows the standard Ionic Angular structure with additional configuration for containerized development:
src/- Application source codedocker-compose.yml- Docker Compose configurationDockerfile- Docker container definitionfastlane/- Fastlane configuration for automated builds and deployments
The Docker setup includes:
- Development Container: Provides a consistent development environment with all required tools
- Android Builder Container: For building Android APKs and AABs
- iOS Integration: For integrating with local iOS builds using Fastlane
Android development can be done completely within Docker containers. The Android container includes:
- Android SDK
- Gradle build system
- Fastlane for automated builds
For running with an Android emulator on your Mac:
# First, start the emulator on your Mac
./start-host-emulator.sh
# Then run the app in Docker connected to your Mac's emulator
./run-android.shSee the Android Emulator Integration Guide for detailed instructions.
iOS builds require macOS, so final iOS builds are done outside the container:
- Develop and test in Docker
- For final builds and deployment to TestFlight/App Store:
npx cap sync ios cd ios/App fastlane ios beta # or fastlane ios release
# Deploy to Google Play internal testing
docker-compose exec android-builder bash -c "cd /app && fastlane android beta"
# Deploy to Google Play production
docker-compose exec android-builder bash -c "cd /app && fastlane android production"# Deploy to TestFlight
fastlane ios beta
# Deploy to App Store
fastlane ios release- Dockerized Development Environment: Ensures consistency across development environments
- Multi-stage Builds: Optimized Docker image sizes
- Automated Deployment: Using Fastlane for consistent deployment process
- Code Organization: Following Angular best practices
- Mobile UI/UX: Using Ionic components and patterns correctly
To connect Android Studio with the containerized ADB:
- Stop the ADB server in Android Studio
- Run the Docker container with ADB exposed (already configured in docker-compose.yml)
- In Android Studio, go to Preferences > Android SDK > SDK Tools and set ADB location to:
tcp:localhost:5037
Use the provided script to automatically start the Docker container and launch Android Studio:
./start-android-dev.shThis script will:
- Stop any running ADB server on your host
- Start the Docker container with
docker compose up android-build - Configure ADB connectivity between the container and host
- Launch Android Studio automatically
For detailed instructions on configuring Android Studio to work with the Docker container, see the Android Studio Integration Guide. ./start-android-dev.sh
This script will:
1. Stop any running ADB server on your host
2. Start the Docker container with `docker compose up android-build`
3. Configure ADB connectivity between the container and host
4. Launch Android Studio automatically
## Troubleshooting
### Common Issues
- **Port conflicts**: If ports are already in use, modify the `docker-compose.yml` file to use different ports
- **Docker connection issues**: Ensure Docker is running with sufficient resources allocated
- **iOS build failures**: Make sure you have the latest Xcode installed and necessary certificates
## License
MIT