{"id":29555733,"url":"https://github.com/t1/quarkus-compose-devservice-demo","last_synced_at":"2025-07-18T09:06:20.708Z","repository":{"id":300529271,"uuid":"1006403142","full_name":"t1/quarkus-compose-devservice-demo","owner":"t1","description":"Advanced demos of using Quarkus Dev Services","archived":false,"fork":false,"pushed_at":"2025-07-09T23:12:10.000Z","size":21,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2025-07-10T09:19:40.831Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/t1.png","metadata":{"files":{"readme":"README.adoc","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,"zenodo":null}},"created_at":"2025-06-22T07:26:21.000Z","updated_at":"2025-07-09T23:12:13.000Z","dependencies_parsed_at":"2025-06-22T08:37:33.991Z","dependency_job_id":null,"html_url":"https://github.com/t1/quarkus-compose-devservice-demo","commit_stats":null,"previous_names":["t1/quarkus-compose-devservice-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/t1/quarkus-compose-devservice-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fquarkus-compose-devservice-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fquarkus-compose-devservice-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fquarkus-compose-devservice-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fquarkus-compose-devservice-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t1","download_url":"https://codeload.github.com/t1/quarkus-compose-devservice-demo/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1%2Fquarkus-compose-devservice-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265730496,"owners_count":23818766,"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":"2025-07-18T09:06:17.429Z","updated_at":"2025-07-18T09:06:20.691Z","avatar_url":"https://github.com/t1.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Quarkus Compose Dev Services Demo\n\nAdvanced demos of using https://quarkus.io[Quarkus] Dev Services:\n\n* a `MockService` class in `/src/dev/java` that runs in `test` and `dev` modes, but not in `prod`.\n* a `compose.yaml` that starts a https://min.io[min.io] S3 server.\nThe `TestDataLoader` class in `/src/test/java` creates a bucket and uploads some test data to the `minio` server.\n\nFor details about the Compose Dev Services, see the corresponding https://quarkus.io/guides/compose-dev-services[Quarkus Guide].\nNote that the `MockService` does not use that mechanism nor a Docker container, but being just a regular Java class, this is a handy alternative for mocking services.\n\n== Usage\n\nStart the dev mode with (we set the `defaultGoal` to `quarkus:dev` in the `dev` profile of the `pom.xml`):\n\n[source,bash]\n----\nmvn -Pdev\n----\n\nThen you can access all endpoints in the Dev UI, or by opening these URLs in your browser, curl, httpie, etc.:\n\n* http://localhost:8080/hello direct greeting\n* http://localhost:8080/mock response from the `MockService`\n* http://localhost:8080/hello/mock greeting utilizing the `MockService`\n* http://localhost:\u003crandom-port\u003e/test/s3.txt response from `S3`\n* http://localhost:8080/hello/s3 greeting utilizing `S3`\n\nYou can also run the tests by pressing `r`.\n\n== Issues\n\n=== Dependency that defines a Dev Service https://github.com/quarkusio/quarkus/issues/48460[#48460]\n\nWe have a dependency on `quarkus-jdbc-postgresql`, even though we don't use it in this demo.\nBut we need some dependency with a Dev Service so the Compose Dev Services load at all.\n\n=== Port Mapping\n\nWhen you run the tests from within the dev mode, a second instance of the Dev Services is started, so we need separate ports for the `minio` service for `test` and `dev` mode.\nThe easiest way to do that is to map the `minio` service port `9000` to a random host port.\n\nWe would also like to bind the network interface only to `localhost`, so the service is not being exposed on a Linux machine (as the default binding is `0.0.0.0`), but then we need to specify the host port as well; `127.0.0.1:9000` doesn't work, because `127.0.0.1` is not a valid port number.\n\nThe https://github.com/compose-spec/compose-spec/blob/main/spec.md[Compose Spec] defines a syntax for specifying a port range, so we could use \"127.0.0.1:9000:9000-9999\", but that syntax is currently not supported by Quarkus Dev Services; it fails with `Error parsing ExposedPort '9000-9999'` in `ExposedPort.java:131`.\n\nThere's also a https://github.com/compose-spec/compose-spec/blob/main/spec.md#long-syntax-3[long form] for the port mapping, but that fails, too:\n\n[source,yaml]\n----\nservices:\n  s3:\n    ports:\n      - name: api\n        target: 9000\n        host_ip: 127.0.0.1\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1%2Fquarkus-compose-devservice-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft1%2Fquarkus-compose-devservice-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1%2Fquarkus-compose-devservice-demo/lists"}