{"id":21539828,"url":"https://github.com/tameronline/cdmlfstr","last_synced_at":"2025-03-17T21:44:19.379Z","repository":{"id":264241892,"uuid":"892757350","full_name":"TamerOnLine/CDMLFSTR","owner":"TamerOnLine","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-22T20:12:23.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T08:11:37.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/TamerOnLine.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":"2024-11-22T18:08:03.000Z","updated_at":"2024-11-22T20:12:27.000Z","dependencies_parsed_at":"2024-11-22T21:35:22.200Z","dependency_job_id":null,"html_url":"https://github.com/TamerOnLine/CDMLFSTR","commit_stats":null,"previous_names":["tameronline/cdmlfstr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamerOnLine%2FCDMLFSTR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamerOnLine%2FCDMLFSTR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamerOnLine%2FCDMLFSTR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamerOnLine%2FCDMLFSTR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TamerOnLine","download_url":"https://codeload.github.com/TamerOnLine/CDMLFSTR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244116995,"owners_count":20400734,"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":[],"created_at":"2024-11-24T04:16:30.236Z","updated_at":"2025-03-17T21:44:19.355Z","avatar_url":"https://github.com/TamerOnLine.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Building a Simple Docker Project with MLflow and Streamlit\n\n## Introduction:\nThis project serves as an educational guide for beginners to set up and run services using Docker and Docker Compose. It focuses on deploying two services:\n1. **MLflow**: An open-source platform to manage the machine learning lifecycle.\n2. **Streamlit**: A simple framework for building interactive web applications for data projects.\n\n---\n\n## Objectives:\n- Introduce beginners to the fundamentals of Docker and Docker Compose.\n- Create separate `Dockerfile`s for MLflow and Streamlit services.\n- Launch both services using a `docker-compose.yml` file.\n\n---\n\n## Setup:\n\n### Prerequisites:\n- **Docker** installed.\n- **Docker Compose** installed.\n- Basic knowledge of Python.\n\n---\n\n## Project Steps:\n\n### 1. Create a Dockerfile for Each Service:\n\n#### Dockerfile for MLflow:\n```dockerfile\nFROM python:3.9-slim\n\n# Install the MLflow library\nRUN pip install mlflow\n\n# Set the working directory\nWORKDIR /app\n\n# Expose the port\nEXPOSE 5001\n\n# Default command to run the MLflow server\nCMD [\"mlflow\", \"server\", \"--host\", \"0.0.0.0\", \"--port\", \"5001\"]\n```\n\n#### Dockerfile for Streamlit:\n```dockerfile\nFROM python:3.9-slim\n\n# Install the Streamlit library\nRUN pip install streamlit\n\n# Copy the application file\nCOPY app.py /app/app.py\n\n# Set the working directory\nWORKDIR /app\n\n# Expose the port\nEXPOSE 8501\n\n# Default command to run the Streamlit app\nCMD [\"streamlit\", \"run\", \"app.py\", \"--server.address=0.0.0.0\", \"--server.port=8501\"]\n```\n\n### 2. Prepare the `app.py` File for Streamlit:\n```python\n# app.py\nimport streamlit as st\n\nst.title(\"Simple Streamlit Application\")\nst.write(\"Welcome to the MLflow integration interface!\")\n```\n\n### 3. Write the `docker-compose.yml` File:\n```yaml\nservices:\n  mlflow:\n    build:\n      context: .\n      dockerfile: Dockerfile.mlflow\n    ports:\n      - \"5001:5001\"\n\n  streamlit:\n    build:\n      context: .\n      dockerfile: Dockerfile.streamlit\n    ports:\n      - \"8501:8501\"\n```\n\n---\n\n## Running the Project:\n\n### 1. Build and Run the Containers:\nRun the following command:\n```bash\ndocker-compose up --build\n```\n\n### 2. Access the Services:\n- **MLflow**: [http://localhost:5001](http://localhost:5001)\n- **Streamlit**: [http://localhost:8501](http://localhost:8501)\n\n---\n\n## Educational Takeaways:\n\n1. **Dockerfile Basics:**\n   - Define the base image (e.g., `python:3.9-slim`).\n   - Install required libraries using `pip install`.\n   - Configure ports using `EXPOSE`.\n   - Specify default commands with `CMD`.\n\n2. **Docker Compose Essentials:**\n   - Combine multiple services into one project.\n   - Define port mappings and network connections between containers.\n\n---\n\n## Future Enhancements:\n- Connect MLflow to a database like MySQL.\n- Add a third service such as an API interface using FastAPI.\n- Enhance the Streamlit interface to enable interaction with MLflow functionalities.\n\n---\n\n## Conclusion:\nThis project provides a foundational understanding of deploying a multi-service application using Docker. It offers a stepping stone for beginners to build more complex and integrated projects in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftameronline%2Fcdmlfstr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftameronline%2Fcdmlfstr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftameronline%2Fcdmlfstr/lists"}