{"id":37162006,"url":"https://github.com/forbiddencoding/docker-compose-watch-golang","last_synced_at":"2026-01-14T19:17:04.363Z","repository":{"id":214184975,"uuid":"693360250","full_name":"forbiddencoding/docker-compose-watch-golang","owner":"forbiddencoding","description":"A simple Golang server to demonstrate the Docker Compose Watch feature.","archived":false,"fork":false,"pushed_at":"2024-04-27T17:24:17.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-16T00:43:11.691Z","etag":null,"topics":["docker","docker-compose","example","file-watcher","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forbiddencoding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-09-18T21:56:47.000Z","updated_at":"2024-06-25T08:35:56.000Z","dependencies_parsed_at":"2023-12-26T13:45:05.618Z","dependency_job_id":"ef5c0ec7-51c7-4f00-8b68-4b1750bfb2a3","html_url":"https://github.com/forbiddencoding/docker-compose-watch-golang","commit_stats":null,"previous_names":["forbiddencoding/docker-compose-watch-golang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/forbiddencoding/docker-compose-watch-golang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fdocker-compose-watch-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fdocker-compose-watch-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fdocker-compose-watch-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fdocker-compose-watch-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forbiddencoding","download_url":"https://codeload.github.com/forbiddencoding/docker-compose-watch-golang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forbiddencoding%2Fdocker-compose-watch-golang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","example","file-watcher","golang"],"created_at":"2026-01-14T19:17:02.861Z","updated_at":"2026-01-14T19:17:04.341Z","avatar_url":"https://github.com/forbiddencoding.png","language":"Go","readme":"# Docker Compose File Watch with Golang\n[![Docker](https://img.shields.io/badge/-Docker-informational?style=for-the-badge\u0026color=27272A\u0026logo=docker)](LICENSE.md)\n[![Golang](https://img.shields.io/badge/-Golang-informational?style=for-the-badge\u0026color=27272A\u0026logo=go)](LICENSE.md)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge\u0026color=27272A)](LICENSE.md)\n\n\u003e To use this feature, you need to be on Docker Compose version 2.22 or higher.\n\u003e To check your version, run `docker compose version`.\n\n## Introduction\n\nThis repository contains a simple Golang application which demonstrates the use of the **Docker Compose Watch** feature.\n\nThis project exposes a simple Golang HTTP server which returns the time of the incoming request. Simply run the project\nand open `http://localhost:8080` in your browser to see the current time.\n\nModify the `main.go` file and save it to see the file watch feature in action.\n\n## What is \"Docker Compose Watch\"?\n\nDocker Compose Watch is a file watch command which automates the update process for running Docker Compose\nservices as developers edit and save their work. By monitoring specified files and directories on the host machine,\nDocker detects changes automatically and performs corresponding actions within the service container.\n\nIf you want to learn more, check out the [official documentation](https://docs.docker.com/compose/file-watch/).\n\n## Usage\n\n1. `docker compose watch` to start the Compose project\n2. (optional) In another terminal, run `docker compose logs -f -t` to see the console output of the services\n\nAlternatively you can utilize the `Makefile` with the following commands:\n\n| Command      | Description                              |\n|--------------|------------------------------------------|\n| `make up`    | Starts the compose project in watch mode |\n| `make down`  | Stops the compose project                |\n| `make prune` | Removes all dangling images              |\n| `make logs`  | Shows the logs of the running service    |\n\n## Caveats\n\nSince in this example, the application is created and run inside the container, every change will trigger a rebuild of\nthe image. This means that a lot of dangling images will be created over time. To remove them, simply run the\n`make prune` command.\n\nIf some might wonder why the code is not mounted as a volume, it's because the watch feature does not monitor mounted\nvolume paths.\n\nHopefully, the Docker team will add a way to prevent this in the future.\n\n## Alternatives\n\nIf you want a stable and tested way for live-reloading your Golang Docker container, I highly recommend taking a look at\n[air](https://github.com/cosmtrek/air). It's a great tool which I use in my own projects.\n\n## License\n\nThis project is licensed under the terms of the MIT License. Feel free to use, modify, and distribute the code\nas per the terms of the license. See the [LICENSE](LICENSE.md) file for more details.\n\n---\n\n\u003cp align=\"center\"\u003eMade in the Black Forest with 🦊 in mind.\u003c/p\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforbiddencoding%2Fdocker-compose-watch-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforbiddencoding%2Fdocker-compose-watch-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforbiddencoding%2Fdocker-compose-watch-golang/lists"}