diff --git a/res/How to Home Server/04 First service.md b/res/How to Home Server/04 First service.md index e1dd878..a1ea3cd 100644 --- a/res/How to Home Server/04 First service.md +++ b/res/How to Home Server/04 First service.md @@ -48,7 +48,7 @@ services: privileged: true # Allow access to the host network for device discovery # Usually, you wouln't do this either, but for HA we need it - # Because we use the host network we do not need to expose container ports + # Because we use the host network we do not need to expose container ports network_mode: host ``` diff --git a/res/TRMNL Hackathon/Self host larapaper.md b/res/TRMNL Hackathon/Self host larapaper.md new file mode 100644 index 0000000..8136cfc --- /dev/null +++ b/res/TRMNL Hackathon/Self host larapaper.md @@ -0,0 +1,43 @@ +## Deploy your own Larapaper + +To self-host larapaper with serverless transforms, you have to use [our fork](https://github.com/spark-hpi/larapaper) of [larapaper](https://github.com/usetrmnl/larapaper). We will once again use [docker compose](../How to Home Server/03 Installing Docker.md) for this. + +We are currently working on merging our fork back into the main repo, but this might take a while. Check for updates on this topic. + +Begin by creating a `compose.yaml` with the following contents: + +```yml +services: + larapaper: + container_name: larapaper + image: ghcr.io/spark-hpi/larapaper:latest + ports: + - "4567:8080" + environment: + - APP_KEY=base64: + - PHP_OPCACHE_ENABLE=1 + - TRMNL_PROXY_REFRESH_MINUTES=15 + - DB_DATABASE=database/storage/database.sqlite + - TRANSFORM_RUNNER_URL=transform-runner:3000 + # - MULTI_USER_MODE=1 # if you are planning to use larapaper with multiple users + volumes: + - database:/var/www/html/database/storage + - storage:/var/www/html/storage/app/public/images/generated + restart: unless-stopped + + transform-runner: + container_name: transform-runner + image: ghcr.io/spark-hpi/larapaper-serverless-runner:latest + security_opt: [seccomp=unconfined] + environment: + - TRANSFORM_TIMEOUT=30 # maximum time a transform may run + - TRANSFORM_MEMORY_LIMIT=134217728 # (128MB) the amount of memory a single transform may use, killed if the limit is exceeded + +volumes: + database: + storage: +``` + +Replace `` inside the `APP_KEY` with the output of the command `openssl rand -hex 16 | base64`. + +For more information, refer to Larapapers [README](https://github.com/spark-hpi/larapaper/blob/main/README.md), create an issue or ask us if you have questions. Pull requests with improvements are also always welcome!