This document provides detailed instructions for deploying this application using Docker.
- Install Docker
- Install Docker Compose
- Clone the repository
git clone <repository-url>
cd ioe- Create environment variable file
cp .env.template .env
# Edit the .env file and fill in the correct configuration information- Build and start containers
docker-compose up --build- Access the application
Open your browser and visit http://localhost:8000
- Clone the repository
git clone <repository-url>
cd ioe- Create environment variable file
cp .env.template .env
# Edit the .env file and fill in the correct configuration information, especially SECRET_KEY and ALLOWED_HOSTS- Start containers with production configuration
docker-compose -f docker-compose.prod.yml up -d- Create a superuser (if needed)
docker-compose -f docker-compose.prod.yml exec web python manage.py createsuperuserIn the production environment, data is stored in Docker volumes:
static_volume: Static filesmedia_volume: Media files (such as uploaded images)db_volume: Database files
- View logs:
docker-compose logs -f - Stop services:
docker-compose down - Restart services:
docker-compose restart - Execute Django management commands:
docker-compose exec web python manage.py <command>
To customize Docker configuration, you can edit the following files:
Dockerfile: Modify the application environmentdocker-compose.yml: Modify development environment service configurationdocker-compose.prod.yml: Modify production environment service configuration
- In the production environment, make sure to set a secure SECRET_KEY
- Update ALLOWED_HOSTS to include your domain name
- Consider using an external database service (such as PostgreSQL) instead of SQLite for better performance
- Regularly backup data in volumes