{"id":15129868,"url":"https://github.com/alich03/docker-flask","last_synced_at":"2026-01-18T00:23:38.719Z","repository":{"id":255672190,"uuid":"853348119","full_name":"alich03/Docker-Flask","owner":"alich03","description":"Integration of Docker Container with Datadog.Docker Compose, Dockerfile and Testing Script","archived":false,"fork":false,"pushed_at":"2024-09-11T09:58:19.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-11T17:13:56.667Z","etag":null,"topics":["docker","docker-compose","flask","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/alich03.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-09-06T13:31:12.000Z","updated_at":"2024-09-11T09:58:23.000Z","dependencies_parsed_at":"2024-10-31T11:15:21.382Z","dependency_job_id":null,"html_url":"https://github.com/alich03/Docker-Flask","commit_stats":null,"previous_names":["alich03/docker-flask"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alich03%2FDocker-Flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alich03%2FDocker-Flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alich03%2FDocker-Flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alich03%2FDocker-Flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alich03","download_url":"https://codeload.github.com/alich03/Docker-Flask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386912,"owners_count":20930734,"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":["docker","docker-compose","flask","python"],"created_at":"2024-09-26T02:22:00.612Z","updated_at":"2026-01-18T00:23:38.678Z","avatar_url":"https://github.com/alich03.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Integration of Docker Container with Datadog\n### Testing Method\n✅[Install the Docker Compose](https://docs.docker.com/compose/install/)\\\n✅Clone my respository\\\n✅Update your `DD_API_KEY`and `DD_SITE` in `docker-compose.yml`\\\n✅Run all containers with `docker-compose up`\n\n\n\n### Docker Compose, Dockerfile and Testing Script\n\nA simple `docker-compose.yml` file is shown as:\n\n```yaml\nversion: \"3\"  # Define the version of the Docker Compose file format\n\nservices:\n  # Datadog agent service configuration\n  datadog-agent:\n    image: datadog/agent:latest                    # Use the latest Datadog agent image\n    container_name: datadog-agent                  # Set a custom name for the container\n    environment:                                   # Environment variables for the Datadog agent\n      - DD_API_KEY=\u003cYOUR API KEY\u003e                  # Replace with your actual Datadog API key\n      - DD_SITE=\u003cYOUR SITE\u003e                        # Datadog site to send data to (e.g., US, EU)\n      - DD_LOGS_ENABLED=true                       # Enable log collection in the Datadog agent\n      - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true  # Collect logs from all containers\n      - DD_APM_ENABLED=true                   # Enable APM (Application Performance Monitoring)\n      - DD_PROCESS_AGENT_ENABLED=true              # Enable the process agent for monitoring\n    volumes:                           # Mount system directories for Docker and host monitoring\n      - /var/run/docker.sock:/var/run/docker.sock:ro  # Read-only access to Docker socket for container monitoring\n      - /proc/:/host/proc/:ro                      # Read-only access to host's proc directory\n      - /sys/fs/cgroup/:/host/sys/fs/cgroup:ro     # Read-only access to host's cgroup directory\n    platform: linux/amd64  # Set the platform to linux/amd64 for compatibility\n\n  # Python application service configuration\n  python-app:\n    build:                                      # Build configuration for the Python app service\n      context: .                                # Set the build context to the current directory\n      dockerfile: Dockerfile              # Specify the Dockerfile to use for building the image\n    depends_on:                                 # Specify dependencies for this service\n      - datadog-agent                 # Ensure that the Datadog agent starts before this service\n    environment:                                # Environment variables for the Python app\n      - DD_AGENT_HOST=datadog-agent    # Set the Datadog agent host for the app to send metrics to\n      - DD_SITE=\u003cYOUR SITE\u003e # Replace with your actual Datadog site (e.g., datadoghq.com, datadoghq.eu)\n    platform: linux/amd64  # Set the platform to linux/amd64 for compatibility\n\n```\n\nA simple `Dockerfile` file is shown as:\n```yaml\nFROM ubuntu:20.04\n\n\n\nRUN apt update \u0026\u0026 apt install software-properties-common -y\nRUN apt install python3 -y \u0026\u0026 apt install python3-pip -y \n\nRUN pip install numpy pandas matplotlib seaborn flask\n\nRUN pip install flask_cors\n\nWORKDIR test_app\n\nCOPY . .\n\nENV FLASK_RUN_HOST=0.0.0.0\n\nRUN apt install software-properties-common \n\nEXPOSE 5000\n\n# CMD [\"python3\",\"app.py\"]\n\n\n# WORKDIR\n\n# ENV \n\n# COPY\n\n# ADD\n```\n\nA simple `testing_script.py` is shown as:\n\n```py\nimport time\nimport logging\n\n# Configure logging\nlogging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')\nlogger = logging.getLogger(__name__)\n\n\ndef main():\n    while True:\n        logger.info('This is an info message')\n        time.sleep(5)\n\n\nif __name__ == \"__main__\":\n    main()\n    \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falich03%2Fdocker-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falich03%2Fdocker-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falich03%2Fdocker-flask/lists"}