{"id":25246516,"url":"https://github.com/aadi-sonwane/todo_app_docker_jenkins","last_synced_at":"2026-04-09T07:03:02.566Z","repository":{"id":274305720,"uuid":"922512242","full_name":"Aadi-Sonwane/todo_app_docker_jenkins","owner":"Aadi-Sonwane","description":"A 2-tier ToDo application using Docker and Jenkins for CI/CD pipeline automation, deployed on AWS EC2. This project showcases best practices in DevOps, containerization, and cloud automation.","archived":false,"fork":false,"pushed_at":"2025-01-28T03:37:09.000Z","size":13769,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:30:43.757Z","etag":null,"topics":["aws-ec2","devops","docker","docker-compose","github-actions","jenkins","python","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aadi-Sonwane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-26T12:20:43.000Z","updated_at":"2025-02-03T09:33:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"742f58f3-934d-413e-ba7b-98086427cc51","html_url":"https://github.com/Aadi-Sonwane/todo_app_docker_jenkins","commit_stats":null,"previous_names":["aadi-sonwane/todo_app_docker_jenkins"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aadi-Sonwane/todo_app_docker_jenkins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aadi-Sonwane%2Ftodo_app_docker_jenkins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aadi-Sonwane%2Ftodo_app_docker_jenkins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aadi-Sonwane%2Ftodo_app_docker_jenkins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aadi-Sonwane%2Ftodo_app_docker_jenkins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aadi-Sonwane","download_url":"https://codeload.github.com/Aadi-Sonwane/todo_app_docker_jenkins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aadi-Sonwane%2Ftodo_app_docker_jenkins/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263861996,"owners_count":23521357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-ec2","devops","docker","docker-compose","github-actions","jenkins","python","sqlite3"],"created_at":"2025-02-12T02:48:19.627Z","updated_at":"2025-12-30T22:15:58.332Z","avatar_url":"https://github.com/Aadi-Sonwane.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Todo App Docker with Jenkins\r\n\r\nThis project demonstrates how to deploy a simple Todo application using Docker and Jenkins for continuous integration and deployment (CI/CD). The app is containerized using Docker, and Docker Compose is used to manage multi-container setups.\r\n\r\n## Features\r\n\r\n- Dockerized Python Django application\r\n- Easy deployment with Docker Compose\r\n- Supports Dockerfile-based deployment for any platform\r\n- Jenkins pipeline for automated deployment (not included in this README)\r\n\r\n## Prerequisites\r\n\r\nEnsure that you have the following installed:\r\n\r\n- Docker\r\n- Docker Compose\r\n- Git (for cloning the repository)\r\n- Jenkins (for automated deployment, if required)\r\n\r\n## Getting Started\r\n\r\n### 1. Clone the Repository\r\n\r\nFirst, clone the repository to your local machine:\r\n\r\n```bash\r\ngit clone https://github.com/Aadi-Sonwane/todo_app_docker_jenkins.git\r\n\r\n```\r\n```bash\r\ncd todo_app_docker_jenkins\r\n```\r\n\r\n\r\n# 2. Dockerfile\r\nThe project uses a Dockerfile to containerize the application.\r\n\r\nDockerfile:\r\n\r\n```bash\r\n# Use the official Python image as the base image\r\nFROM python:3.9\r\n\r\n# Set the working directory inside the container\r\nWORKDIR /app\r\n\r\n# Copy requirements.txt file into the container\r\nCOPY requirements.txt /app/\r\n\r\n# Install Python dependencies\r\nRUN pip install --no-cache-dir -r requirements.txt\r\n\r\n# Copy the entire project into the container\r\nCOPY . /app/\r\n\r\n# Expose the port the app runs on\r\nEXPOSE 8000\r\n\r\n# Run the application on the specified port\r\nCMD [\"python\", \"manage.py\", \"runserver\", \"0.0.0.0:8000\"]\r\n\r\n```\r\n\r\n\r\n# 3. Docker Compose\r\nDocker Compose is used to manage multiple containers and run them together. In this project, you can use Docker Compose to run both the Django application and any required services (like MySQL, if you use it).\r\ndocker-compose.yml:\r\n[docker-compose.yml](/todo_app_docker_jenkins/docker-compose.yml)\r\n```bash [docker]\r\nversion: \"3.8\"\r\n\r\nservices:\r\n  django_app:\r\n    build:\r\n      context: .\r\n    image: toda_app_compose\r\n    container_name: toda_app_dj\r\n    ports:\r\n      - \"8000:8000\"\r\n    environment:\r\n      - PYTHONUNBUFFERED=1\r\n    volumes:\r\n      - .:/app\r\n    networks:\r\n      - toda_app_network\r\n    restart: always\r\n\r\n  db:\r\n    image: mysql:5.7\r\n    container_name: db_cont\r\n    environment:\r\n      - MYSQL_ROOT_PASSWORD=rootpassword\r\n      - MYSQL_DATABASE=toda_app_db\r\n    volumes:\r\n      - db_data:/var/lib/mysql\r\n    networks:\r\n      - toda_app_network\r\n    restart: always\r\n\r\nnetworks:\r\n  toda_app_network:\r\n    driver: bridge\r\n\r\nvolumes:\r\n  db_data:\r\n\r\n```\r\n# 4. Build and Run with Docker Compose\r\nTo build and run the application using Docker Compose, follow these steps:\r\n1. Build and start the containers:\r\n```bash\r\ndocker-compose up -d --build\r\n```\r\n\r\n2. Check the status of the running containers:\r\n```bash\r\ndocker compose ps \r\n```\r\n3. Access the Django application:\r\n```bash\r\n- Visit http://localhost:8000/ in your browser.\r\n```\r\n4. If you need to stop the containers:\r\n```bash\r\ndocker-compose down\r\n```\r\n\r\n\r\n#5. Running the Application Using Dockerfile (Without Docker Compose)\r\nIf you don't want to use Docker Compose, you can directly use the Dockerfile to build and run the application.\r\n1. Build the Docker image:\r\n```bash\r\ndocker build -t toda_app .\r\n```\r\n2. Run the Docker container:\r\n```bash\r\ndocker run -d -p 8000:8000 --name toda_app_container toda_app\r\n```\r\n\r\n3.Access the Django application:\r\n- Visit http://localhost:8000/ in your browser.\r\n\r\n4. To stop the container\r\n   ```bash\r\n    docker stop toda_app_container\r\n   ```\r\n\r\n# 6. Environment Variables (Optional)\r\n- You can configure the app using environment variables. Here are a few commonly used ones:\r\n```json\r\nDATABASE_URL: The URL for connecting to the database. \r\nExample: DATABASE_URL=mysql://root:rootpassword@db/toda_app_db\r\n```\r\n- Make sure to set the necessary environment variables in the docker-compose.yml file or in a .env file.\r\n\r\n# Troubleshooting\r\nDisallowedHost Error: \r\nIf you encounter an error like Invalid HTTP_HOST header, make sure to update **ALLOWED_HOSTS** in settings.py with the appropriate host or IP address \r\n_(e.g., ['localhost', '0.0.0.0', '127.0.0.1', 'your-server-ip'])._\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadi-sonwane%2Ftodo_app_docker_jenkins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faadi-sonwane%2Ftodo_app_docker_jenkins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faadi-sonwane%2Ftodo_app_docker_jenkins/lists"}