{"id":21893604,"url":"https://github.com/xhmm/rust-http-server-docker-example","last_synced_at":"2025-08-27T04:05:16.123Z","repository":{"id":231468879,"uuid":"781821491","full_name":"XHMM/rust-http-server-docker-example","owner":"XHMM","description":"A dockerized rust http server","archived":false,"fork":false,"pushed_at":"2024-04-04T17:11:12.000Z","size":1758,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T03:44:44.820Z","etag":null,"topics":["docker","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/XHMM.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}},"created_at":"2024-04-04T05:23:59.000Z","updated_at":"2024-04-04T06:54:07.000Z","dependencies_parsed_at":"2024-04-04T06:30:22.379Z","dependency_job_id":"e366fdb9-584f-43b6-a4f0-57a9180a316e","html_url":"https://github.com/XHMM/rust-http-server-docker-example","commit_stats":null,"previous_names":["xhmm/rust-http-server-docker-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/XHMM/rust-http-server-docker-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Frust-http-server-docker-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Frust-http-server-docker-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Frust-http-server-docker-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Frust-http-server-docker-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XHMM","download_url":"https://codeload.github.com/XHMM/rust-http-server-docker-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XHMM%2Frust-http-server-docker-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272289086,"owners_count":24907797,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","rust"],"created_at":"2024-11-28T13:15:24.471Z","updated_at":"2025-08-27T04:05:16.079Z","avatar_url":"https://github.com/XHMM.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust http server example\n\nA dockerized rust http server, it implements an endpoint using tinyapi for image compression.\n\n- Caching support by [cargo-chef](https://github.com/LukeMathWalker/cargo-chef/tree/main)\n- Minimal image size and runtime by [distroless](https://github.com/GoogleContainerTools/distroless/tree/main)\n- Cargo registry configured under `.cargo/config.toml`\n\n## Build and run\n\n### Build\nWe need get the target name when building rust application, you can set the target name from cli:\n\n```shell\ndocker build --build-arg BUILD_TARGET=image-compress -t rust-http-demo .\n```\n\nor update the first line in the `Dockerfile`:\n```dockerfile\nARG BUILD_TARGET=image-compress\n```\n\n### Run\n\nGet tiny api key from the [official doc](https://tinypng.com/developers)\n\n```shell\ndocker run -p 8080:8080 -e TINY_API_KEY=\u003cYOUR KEY\u003e rust-http-demo\n```\n\n### Visit\n\nHealth check:\n\n```shell\ncurl http://localhost:8080/health\n```\n\nCompress:\n\n```shell\ncurl -X POST --data-binary @image.jpg http://localhost:8080/compress -OJ\n```\n\n## Change cargo registry\n\nCargo registry was changed for China users, if yor network works well with the default cargo registry, you can remove `source` config in the `.cargo/config.toml` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhmm%2Frust-http-server-docker-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxhmm%2Frust-http-server-docker-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhmm%2Frust-http-server-docker-example/lists"}