From d55a4aa023c39153abb989594a9b86b50dafdc1d Mon Sep 17 00:00:00 2001 From: Kaki Filem Team Date: Sat, 31 Jan 2026 20:35:11 +0800 Subject: [PATCH] Initial commit --- Caddyfile | 15 +++++++++ Dockerfile | 19 +++++++++++ assets/typesense-icon.svg | 1 + readme.md | 68 ++++++++++++++++++++++++++++++++++++++ scripts/start.sh | 7 ++++ scripts/start_caddy.sh | 3 ++ scripts/start_typesense.sh | 3 ++ 7 files changed, 116 insertions(+) create mode 100644 Caddyfile create mode 100644 Dockerfile create mode 100644 assets/typesense-icon.svg create mode 100644 readme.md create mode 100644 scripts/start.sh create mode 100644 scripts/start_caddy.sh create mode 100644 scripts/start_typesense.sh diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..1acf841 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,15 @@ +# global options +{ + admin off # theres no need for the admin api in railway's environment + persist_config off # storage isn't persistent anyway + auto_https off # railway handles https for us, this could in some cases cause issues if left enabled + # runtime logs + log { + output discard # theres no need for caddy's runtime logs + } +} + +# site block, listens on the $PORT environment variable, automatically assigned by railway +:{$PORT} { + reverse_proxy http://127.0.0.1:8118 +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6b5f0ef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine:latest AS parallel +RUN apk add --no-cache parallel + +FROM caddy:latest AS caddy +COPY Caddyfile ./ +RUN caddy fmt --overwrite Caddyfile + +FROM typesense/typesense:30.0.rca35 + +COPY --from=caddy /srv/Caddyfile ./ + +COPY --from=caddy /usr/bin/caddy /usr/bin/caddy +COPY --from=parallel /usr/bin/parallel /usr/bin/parallel + +COPY --chmod=755 scripts/* ./ + +ENTRYPOINT ["/bin/sh"] + +CMD ["start.sh"] \ No newline at end of file diff --git a/assets/typesense-icon.svg b/assets/typesense-icon.svg new file mode 100644 index 0000000..676bf9a --- /dev/null +++ b/assets/typesense-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..04713e5 --- /dev/null +++ b/readme.md @@ -0,0 +1,68 @@ +ο»Ώ# Railway-Ready Typesense + +A modern **Typesense** deployment template built specifically for **Railway**, using updated images and safe, production-ready defaults. + +--- + +## πŸš€ Deploy on Railway + +[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/typesense-updated?referralCode=nIQTyp&utm_medium=integration&utm_source=template&utm_campaign=generic) + +--- + +## ✨ Features + +- βœ… Updated Typesense image (v30-ready) +- βœ… Railway-friendly startup scripts +- βœ… Persistent data storage (no accidental data loss) +- βœ… Clean default configuration +- βœ… Easy upgrade path to future Typesense releases + +--- + +## 🧱 What’s Included + +- **Typesense** (latest supported image) +- **Caddy** (optional reverse proxy) +- Proper volume mounting for `/data` +- Startup scripts tested on Railway + +--- + +## βš™οΈ Configuration + +After deployment, Railway will automatically generate the required environment variables. + +Important variables: + +- `TYPESENSE_API_KEY` – Admin API key +- `TYPESENSE_DATA_DIR` – Persistent data directory + +You can manage these in **Railway β†’ Variables** at any time. + +--- + +## πŸ”’ Production Notes + +- This template is **production-ready by default** +- Designed to avoid common Railway container issues +- Uses stable configuration patterns recommended by Typesense + +> If a release-candidate image is used, it can be upgraded to a stable release without changing the template name. + +--- + +## πŸ›  Maintenance + +- Update Typesense versions via the `Dockerfile` +- No breaking changes required for minor upgrades +- Template naming remains stable over time + +--- + +## πŸ“„ License + +Typesense is licensed under the **Apache License 2.0**. + +This template is community-maintained. + diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..44436c2 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +parallel --ungroup --halt now,done=1 ::: \ + "./start_caddy.sh" \ + "./start_typesense.sh" + +false \ No newline at end of file diff --git a/scripts/start_caddy.sh b/scripts/start_caddy.sh new file mode 100644 index 0000000..9ea8246 --- /dev/null +++ b/scripts/start_caddy.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec caddy run --config Caddyfile --adapter caddyfile 2>&1 \ No newline at end of file diff --git a/scripts/start_typesense.sh b/scripts/start_typesense.sh new file mode 100644 index 0000000..656de58 --- /dev/null +++ b/scripts/start_typesense.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /opt/typesense-server --api-address 127.0.0.1 --api-port 8118 \ No newline at end of file