Docker Development
This guide focuses on setting up a development environment for OpenAlgo using Docker.
Prerequisites
Docker Engine
Docker Compose
Git
Files Required
1. Dockerfile
2. docker-compose.yml
3. .dockerignore
Quick Start
Create Environment File:
Copy
.sample.env
to.env
:Build and Start:
View Logs:
Development Features
Hot reload enabled (code changes reflect immediately)
Debug mode active
Console logging
Port 5000 exposed
Volume mounting for live code updates
Common Commands
Directory Structure
Development Tips
Live Reload:
Code changes will automatically reload
Check logs for errors after changes
Database Access:
SQLite database persists in ./db directory
Can be accessed from both host and container
Debugging:
Logs are printed to console
Debug mode enables detailed error pages
Dependencies:
Add new packages to requirements-nginx.txt
Rebuild container after adding dependencies:
Troubleshooting
Port Already In Use:
Database Issues:
Container Won't Start:
Package Installation Issues:
Note
This configuration is optimized for development. For production deployment, additional security measures and optimizations would be necessary.
Last updated