{"id":42503176,"url":"https://github.com/chriskyfung/carrot2-stack","last_synced_at":"2026-02-24T09:29:55.033Z","repository":{"id":332518413,"uuid":"1134059320","full_name":"chriskyfung/carrot2-stack","owner":"chriskyfung","description":"Docker stack for deploying Carrot2 with Cloudflare Tunnel","archived":false,"fork":false,"pushed_at":"2026-01-14T07:42:47.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-14T11:26:31.394Z","etag":null,"topics":["carrot2","cloudflared","docker-compose","dockerfile","selfhost","text-clustering","web-clustering"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-4-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chriskyfung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-14T07:32:31.000Z","updated_at":"2026-01-14T07:42:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chriskyfung/carrot2-stack","commit_stats":null,"previous_names":["chriskyfung/carrot2-stack"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chriskyfung/carrot2-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskyfung%2Fcarrot2-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskyfung%2Fcarrot2-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskyfung%2Fcarrot2-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskyfung%2Fcarrot2-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chriskyfung","download_url":"https://codeload.github.com/chriskyfung/carrot2-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskyfung%2Fcarrot2-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T13:02:32.985Z","status":"ssl_error","status_checked_at":"2026-01-28T13:02:04.945Z","response_time":57,"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":["carrot2","cloudflared","docker-compose","dockerfile","selfhost","text-clustering","web-clustering"],"created_at":"2026-01-28T13:32:35.155Z","updated_at":"2026-01-28T13:32:35.216Z","avatar_url":"https://github.com/chriskyfung.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🥕 Carrot2 Dockerized Deployment\n\nThis project provides a Dockerized setup for deploying Carrot2, focusing on optimization, security, and ease of deployment. It leverages Docker multi-stage builds for efficient image creation, includes optional support for Chinese, Japanese, and Korean (CJK) languages, and integrates with Cloudflare Tunnel for secure exposure.\n\n## 📜 Project Overview\n\nThe core of this project is to package the Carrot2 application into a lightweight and secure Docker image. Key features include:\n\n*   **Optimized Dockerfile:** Uses multi-stage builds to separate build dependencies from the final runtime image, resulting in a smaller footprint. It also follows security best practices by creating and running as a non-root user.\n*   **Carrot2 Versioning:** The version of Carrot2 to install is parameterized, and checksum verification is used to ensure the integrity of the downloaded binaries.\n*   **CJK Language Support:** Optional installation of Chinese, Japanese, and Korean language extensions.\n*   **Persistent Data:** Carrot2's data directory (`/opt/carrot2/data`) is configured as a Docker volume to persist data across container restarts.\n*   **Cloudflare Tunnel Integration:** The `compose.yaml` includes a `cloudflared` service to expose the Carrot2 instance securely to the internet via a Cloudflare Tunnel.\n\n## 🚀 Getting Started\n\n### 🔧 Building the Docker Image\n\nThe Docker image can be built directly from the `Dockerfile`. Several build arguments can be used to customize the build.\n\n*   `CARROT2_VERSION`: The version of Carrot2 to install.\n*   `CARROT2_CHECKSUM_SHA256`: The SHA256 checksum of the Carrot2 zip file.\n*   `CARROT2_LANG_EXTENSIONS`: A comma-separated list of language extensions to install (e.g., \"chinese,japanese,korean\").\n\n```bash\n# Build the default version (with CJK support)\ndocker build . -t carrot2:latest\n\n# Build a specific version without CJK support\ndocker build \\\n  --build-arg CARROT2_VERSION=4.8.4 \\\n  --build-arg CARROT2_CHECKSUM_SHA256=31fc65c15e2f02e46e1c2e629ef72958d234e8d8d0b0dcc169d1409ccfc79002 \\\n  --build-arg CARROT2_LANG_EXTENSIONS=\"\" \\\n  . -t carrot2:4.8.4\n```\n\n### 🏃 Running with Docker Compose\n\nThe `compose.yaml` file provides a simple way to run both the Carrot2 service and the `cloudflared` tunnel. The default `compose.yaml` builds an image with CJK support.\n\n1.  **Configure Cloudflare Tunnel Token:**\n    Create a file at `.secrets/tunnel_token.txt` and place your Cloudflare Tunnel token inside it. You can obtain a token from the Cloudflare Zero Trust dashboard.\n\n    ```plaintext\n    your-cloudflare-tunnel-token-here\n    ```\n\n2.  **Start the Services:**\n    Navigate to the project root and execute the following command:\n\n    ```bash\n    docker compose up -d\n    ```\n\n    This command will build the image if it doesn't exist, and then start the `carrot2` and `cloudflared` services in detached mode. Carrot2 will be accessible publicly through your configured Cloudflare Tunnel.\n\n## 📝 Development Conventions\n\n*   **Dockerfile:** Follows Docker best practices, including multi-stage builds to download and install Carrot2 and its language extensions, non-root user execution, and explicit environment variable settings (`JAVA_HOME`, `JAVA_OPTS`).\n*   **Checksum Verification:** Ensures the integrity of the downloaded Carrot2 binaries.\n*   **Health Checks:** Integrated into both the `Dockerfile` and `compose.yaml` for robust service monitoring.\n*   **Image Metadata:** Includes OCI image labels for better traceability and understanding of the image.\n*   **Language Extensions:** The `Dockerfile` is designed to be easily extended with additional language packs by modifying the build arguments and adding the necessary download and installation steps.\n\n## 📄 License\n\nThis project is licensed under the terms of the [MIT License](LICENSE).\n\nCarrot2 is distributed under its own [license](carrot2.LICENSE). Please see the `carrot2.LICENSE` and `carrot2.NOTICE` files for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriskyfung%2Fcarrot2-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchriskyfung%2Fcarrot2-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriskyfung%2Fcarrot2-stack/lists"}