{"id":20408855,"url":"https://github.com/dockersamples/compose-dev-env","last_synced_at":"2025-05-16T14:07:44.485Z","repository":{"id":41266890,"uuid":"378978099","full_name":"dockersamples/compose-dev-env","owner":"dockersamples","description":"Example used to try a compose application with Docker Dev Environments","archived":false,"fork":false,"pushed_at":"2024-12-01T03:37:06.000Z","size":15,"stargazers_count":147,"open_issues_count":6,"forks_count":157,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T12:52:25.715Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dockersamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2021-06-21T15:28:40.000Z","updated_at":"2025-04-04T04:01:58.000Z","dependencies_parsed_at":"2025-02-12T05:31:54.980Z","dependency_job_id":"2f768aee-4323-4498-9b5c-cdb461d84a2e","html_url":"https://github.com/dockersamples/compose-dev-env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcompose-dev-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcompose-dev-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcompose-dev-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fcompose-dev-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dockersamples","download_url":"https://codeload.github.com/dockersamples/compose-dev-env/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"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-15T05:37:28.404Z","updated_at":"2025-05-16T14:07:39.476Z","avatar_url":"https://github.com/dockersamples.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compose-dev-env\nExample used to try a Compose application with Docker Dev Environments.\n\nThis example is based on the `nginx-golang-mysql` sample of [`awesome-compose` repository](https://github.com/docker/awesome-compose/).\n\n## Compose sample application\n### Go server with an Nginx proxy and a MariaDB database\n\nProject structure:\n```\n.\n├── backend\n│   ├── Dockerfile\n│   ├── go.mod\n│   └── main.go\n├── db\n│   └── password.txt\n├── docker-compose.yaml\n├── proxy\n│   ├── conf\n│   └── Dockerfile\n└── README.md\n```\n\n[_.docker/docker-compose.yaml_](.docker/docker-compose.yaml)\n```\nservices:\n  backend:\n    build: backend\n    ...\n  db:\n    image: mariadb\n    ...\n  proxy:\n    build: proxy\n    ports:\n    - 8080:80\n    ...\n```\nThe compose file defines an application with three services `proxy`, `backend` and `db`.\nWhen deploying the application, docker-compose maps port 80 of the proxy service container to port 8080 of the host as specified in the file.\nMake sure port 8080 on the host is not already being in use.\n\n## Deploy with docker-compose\n\n```\n$ docker-compose up -d\nCreating network \"compose-dev-env_default\" with the default driver\nCreating volume \"compose-dev-env_db-data\" with default driver\nBuilding backend\nStep 1/8 : FROM golang:1.13-alpine AS build\n1.13-alpine: Pulling from library/golang\n...\nSuccessfully built 5f7c899f9b49\nCreating compose-dev-env_db_1 ... done\nCreating compose-dev-env_backend_1 ... done\nCreating compose-dev-env_proxy_1   ... done\n```\n\n## Expected result\n\nListing containers must show three containers running and the port mapping as below:\n```\n$ docker ps\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES\nd6752b317e6d   compose-dev-env_proxy                 \"nginx -g 'daemon of…\"   About a minute ago   Up About a minute   0.0.0.0:8080-\u003e80/tcp, :::80-\u003e80/tcp   compose-dev-env_proxy_1\n70bf9182ea52   compose-dev-env_backend               \"/server\"                About a minute ago   Up About a minute   8000/tcp                            compose-dev-env_backend_1\nc67de604799d   mariadb                               \"docker-entrypoint.s…\"   About a minute ago   Up About a minute   3306/tcp                            compose-dev-env_db_1\n```\n\nAfter the application starts, navigate to `http://localhost:8080` in your web browser or run:\n```\n$ curl localhost:8080\n[\"Blog post #0\",\"Blog post #1\",\"Blog post #2\",\"Blog post #3\",\"Blog post #4\"]\n```\n\nStop and remove the containers\n```\n$ docker-compose down\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fcompose-dev-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdockersamples%2Fcompose-dev-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fcompose-dev-env/lists"}