Initial commit

This commit is contained in:
Kaki Filem Team 2026-01-31 20:35:11 +08:00
commit d55a4aa023
7 changed files with 116 additions and 0 deletions

15
Caddyfile Normal file
View File

@ -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
}

19
Dockerfile Normal file
View File

@ -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"]

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 255"><path fill="#1035BC" d="M75.104 80.303c.551 2.751.826 5.41.826 7.979c0 2.384-.275 4.951-.826 7.702l-34.938-.275v92.437c0 7.703 3.576 11.554 10.729 11.554h20.908c1.284 3.118 1.926 6.236 1.926 9.354c0 3.118-.184 5.044-.55 5.777c-8.437 1.1-17.149 1.65-26.135 1.65c-17.79 0-26.686-7.61-26.686-22.833V95.709l-19.533.275C.275 93.234 0 90.666 0 88.282c0-2.568.275-5.228.825-7.979l19.533.275V51.692c0-4.952.734-8.437 2.2-10.454c1.468-2.201 4.31-3.302 8.53-3.302h7.427l1.65 1.651v41.267l34.94-.551Zm10.477 125.255c.178-4.02 1.275-8.405 3.286-13.156c2.194-4.934 4.661-8.771 7.401-11.512c14.436 7.857 27.134 11.786 38.1 11.786c6.026 0 10.87-1.188 14.524-3.563c3.837-2.376 5.759-5.573 5.759-9.594c0-6.395-4.935-11.511-14.803-15.349l-15.35-5.755c-23.022-8.406-34.534-21.836-34.534-40.292c0-6.578 1.186-12.425 3.564-17.541c2.557-5.3 6.026-9.776 10.415-13.43c4.567-3.838 9.958-6.761 16.173-8.771c6.21-2.01 13.154-3.016 20.829-3.016c3.47 0 7.307.275 11.511.823c4.384.548 8.772 1.37 13.155 2.467c4.388.913 8.588 2.01 12.609 3.289c4.02 1.279 7.49 2.65 10.415 4.111c0 4.568-.914 9.319-2.74 14.253c-1.827 4.934-4.295 8.588-7.402 10.963c-14.436-6.395-26.95-9.593-37.548-9.593c-4.75 0-8.499 1.188-11.239 3.564c-2.74 2.192-4.11 5.116-4.11 8.77c0 5.665 4.567 10.142 13.706 13.43l16.719 6.03c12.057 4.203 21.013 9.96 26.86 17.268c5.848 7.31 8.772 15.806 8.772 25.49c0 12.974-4.845 23.39-14.53 31.246c-9.685 7.675-23.57 11.513-41.659 11.513c-17.726 0-34.356-4.478-49.883-13.431Zm150.807 48.031V.83c2.762-.554 5.894-.83 9.396-.83c3.682 0 7.09.276 10.216.829v252.76c-3.127.552-6.534.83-10.216.83c-3.502 0-6.634-.278-9.396-.83Z"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

68
readme.md Normal file
View File

@ -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
---
## 🧱 Whats 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.

7
scripts/start.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
parallel --ungroup --halt now,done=1 ::: \
"./start_caddy.sh" \
"./start_typesense.sh"
false

3
scripts/start_caddy.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec caddy run --config Caddyfile --adapter caddyfile 2>&1

View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /opt/typesense-server --api-address 127.0.0.1 --api-port 8118