{"id":28719167,"url":"https://github.com/kavinda-100/docker-bun-practice","last_synced_at":"2026-04-09T17:55:46.102Z","repository":{"id":298250648,"uuid":"999333468","full_name":"kavinda-100/docker-bun-practice","owner":"kavinda-100","description":"This a Sample application for docker with simple backend api with bun js and express js. it uses docker latest watch feature  for smooth development.","archived":false,"fork":false,"pushed_at":"2025-06-10T05:56:52.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-10T06:33:45.855Z","etag":null,"topics":["api-rest","bunjs","docker","docker-compose","expressjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kavinda-100.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,"zenodo":null}},"created_at":"2025-06-10T05:19:27.000Z","updated_at":"2025-06-10T05:56:55.000Z","dependencies_parsed_at":"2025-06-10T06:43:58.758Z","dependency_job_id":null,"html_url":"https://github.com/kavinda-100/docker-bun-practice","commit_stats":null,"previous_names":["kavinda-100/docker-bun-practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kavinda-100/docker-bun-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Fdocker-bun-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Fdocker-bun-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Fdocker-bun-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Fdocker-bun-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kavinda-100","download_url":"https://codeload.github.com/kavinda-100/docker-bun-practice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinda-100%2Fdocker-bun-practice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259929946,"owners_count":22933527,"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":["api-rest","bunjs","docker","docker-compose","expressjs"],"created_at":"2025-06-15T06:00:23.991Z","updated_at":"2025-12-30T22:33:42.610Z","avatar_url":"https://github.com/kavinda-100.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Bun Example\n\nThis is a simple example of a Dockerized Bun application. It uses Bun as the JavaScript runtime and includes a basic setup for running a server with TypeScript and Express. It also includes a Dockerfile for building the application image and a `docker-compose.yml` file for running the application in a container. and it use docker latest feature `develop` to sync files and rebuild the container when changes are made instead of volumes.\n\n## Features\n\n- Uses Bun as the JavaScript runtime\n- TypeScript for type safety\n- Express for handling HTTP requests\n- Dockerized for easy deployment\n- Automatically rebuilds the container when changes are made using Docker's `develop` feature\n- Includes a simple health check endpoint\n- Uses `bun.lockb` for dependency management\n- Includes a Dockerfile for building the application image\n- Includes a `docker-compose.yml` file for running the application in a container\n\n### Usage\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/kavinda-100/docker-bun-practice.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd docker-bun-practice\n   ```\n\n3. Build and run the application using Docker Compose:\n\n   ```bash\n   docker-compose up --watch\n   ```\n\n4. Stop the application:\n\n   ```bash\n   docker-compose down\n   ```\n\n\u003e[!NOTE]\n\u003e The `docker compose down` command stops and removes the containers, networks, and volumes created by \u003e`docker-compose up`. If you want to keep the data in the volumes, you can use `docker-compose stop` instead.\n\n\u003e[!Important]\n\u003e Make sure you have Docker and Docker Compose installed on your machine. The `--watch` flag is used to enable the `develop` feature, which allows for automatic sync of the container when changes are made to the source files.\n\n- Open your browser and navigate to `http://localhost:5000` to see the application running.\n\n### Routes\n\n- `GET /`: Returns a simple message indicating that the server is running.\n- `GET /health`: Returns a health check message indicating that the server is healthy.\n- `GET /api/v1/posts`: Returns a Message indicating that the posts endpoint is working.\n\n### Other Commands\n\n- To run the application without Docker Compose, you can use the following command:\n\n  ```bash\n  bun run dev\n  ```\n\n- To  remove the Docker image and container, you can use the following command:\n\n  ```bash\n  docker-compose down\n  ```\n\n- To rebuild the Docker image, you can use the following command:\n\n  ```bash\n  docker-compose build\n  ```\n\n- To remove the Docker container, you can use the following command:\n\n  ```bash\n  docker rm backend-bun-container\n  ```\n\n- To remove the Docker image, you can use the following command:\n\n  ```bash\n  docker rmi docker-bun-practice\n  ```\n\n### Folder Structure\n\n```\ndocker-bun-practice/\n├── src/\n│   ├── routes/\n│   │   ├── index.ts\n│   │   └── post.route.ts\n│   └── index.ts\n├── Dockerfile\n├── docker-compose.yml\n├── .dockerignore\n├── .gitignore\n├── .env\n├── package.json\n├── bun.lockb\n├── tsconfig.json\n└── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavinda-100%2Fdocker-bun-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkavinda-100%2Fdocker-bun-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavinda-100%2Fdocker-bun-practice/lists"}