mirror of
https://codeberg.org/gigirassy/teletraan.git
synced 2026-08-30 23:27:39 +00:00
98 lines
2.4 KiB
Markdown
98 lines
2.4 KiB
Markdown
# teletraan
|
|
|
|
a static binary-based rootless dockerized web server that is so small, it is effectively braindead, while remaining featureful for most usecases.
|
|
|
|
the server can run rootless, read-only, and distroless, making it lighter and more secure than nginx. it serves everything in the /data folder
|
|
|
|
inspired by busybox httpd.
|
|
|
|
in less than 150 loc, it currently supports:
|
|
|
|
- gzipped files
|
|
- serving single page webapps like cinny nginx-style via the ``-s`` flag
|
|
- serving formats other than html as the index with the ``-i`` flag.
|
|
|
|
it has extremely minimal dependencies, so minimal that you can tack on a crapload of compilation options and use nightly rust without harming binary functionality.
|
|
|
|
it is compiled with ``panic=immediate-abort``.
|
|
|
|
## example usage
|
|
|
|
### compose file
|
|
|
|
in a compose file, you can use teletraan to run your static site stack:
|
|
|
|
```yaml
|
|
services:
|
|
site-with-index.txt:
|
|
image: codeberg.org/gigirassy/teletraan:latest
|
|
read_only: true
|
|
volumes:
|
|
- "./site:/data"
|
|
command: "-i" # site made of txt files
|
|
ports:
|
|
- "127.0.0.1:9900:3000"
|
|
spa-matrix-client:
|
|
image: codeberg.org/gigirassy/teletraan:latest
|
|
read_only: true
|
|
volumes:
|
|
- "./cinny:/data"
|
|
command: "-s" # single page app
|
|
ports:
|
|
- "127.0.0.1:9901:3000"
|
|
basic-html-site:
|
|
image: codeberg.org/gigirassy/teletraan:latest
|
|
read_only: true
|
|
volumes:
|
|
- "./basic-html-site:/data"
|
|
# no command: flags needed!
|
|
ports:
|
|
- "127.0.0.1:9904:3000"
|
|
```
|
|
|
|
use external caddy or nginx to reverse proxy the host ports either way.
|
|
|
|
|
|
### dockerfile
|
|
an image of cinny can be easily and quickly built with teletraan as the server. we just need to specify ``CMD ["-s"]`` at the end.
|
|
|
|
```
|
|
FROM ghcr.io/cinnyapp/cinny:v4.12.3 AS source
|
|
|
|
FROM codeberg.org/gigirassy/teletraan:latest AS runtime
|
|
|
|
COPY --from=source /usr/share/nginx/html .
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["-s"]
|
|
```
|
|
|
|
a simple image for your static site can be built easily. you dont have to specify a cmd!
|
|
|
|
```
|
|
FROM codeberg.org/gigirassy/teletraan:latest
|
|
|
|
COPY /static .
|
|
|
|
EXPOSE 3000
|
|
```
|
|
|
|
if your static site is made of txt files, use the ``CMD ["-i"]`` flag to serve your index.txt file in the webroot as the index.
|
|
|
|
```
|
|
FROM codeberg.org/gigirassy/teletraan:latest
|
|
|
|
COPY /doc .
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["-i"]
|
|
```
|
|
|
|
use external caddy or nginx to reverse proxy the host ports either way.
|
|
|
|
|
|
## license
|
|
|
|
ISC |