Replies: 4 comments 1 reply
-
Hello @r4nchy Basically Sablier works as a standalone API. However, most of the time, it's not that useful for anyone to make calls manually to the API to start containers. In that case what you want is Sablier + a Sablier Reverse Proxy plugin. We'll go step-by-step: 1. Identify your providerThe first thing to do is to install Sablier and connect it to your infrastructure. In your case, given you are using docker-compose and no swarm related configuration, your provider would be The documentation to setup the provider is here: https://sablierapp.dev/#/providers/docker But basically, what you need to add this to your current compose file: services:
sablier:
image: sablierapp/sablier:1.8.1
command:
- start
- --provider.name=docker
volumes:
- '/var/run/docker.sock:/var/run/docker.sock' That's it, now the API exist, and we can send API calls to Sablier (if we forward the port 10000). Important If you want Sablier on another compose file, you need to use the same docker network as Caddy will have to be able to send requests to Sablier directly later. 2. Identify your reverse proxyNow that Sablier is set up, we need to setup the reverse proxy. In your case, you are using Caddy, so if we refer to the Caddy plugin configuration on how to install it: We will extend your Dockerfile, as you did with cloudflare. FROM caddy:builder-alpine AS builder
RUN xcaddy build \
--with github.com/caddy-dns/cloudflare \
--with github.com/sablierapp/sablier/plugins/caddy
FROM caddy:latest
COPY --from=builder /usr/bin/caddy /usr/bin/caddy 3. Connect it all togetherNow you need two things:
3.1 Register the container(s) to shut down automatically using labelsYou must add labels to the containers you want to shutdown: https://sablierapp.dev/#/providers/docker?id=register-containers Given the Caddyfile entry, it seems to be a jellyfin container. Find that container definition, add the labels like: services:
jellyfin:
image: ...
labels:
- sablier.enable=true
- sablier.group=jellyfin Then 3.2 Add the Sablier Caddy plugin entry to your Caddyfile configuration fileInside your Caddyfile rule: jellyfin.example.org {
reverse_proxy http://192.168.0.104:7601 {
header_up Host {host}
header_up X-Forwarded-Proto {scheme}
}
tls {
dns cloudflare _Q*********************VP
}
} You should add the plugin configuration as mentioned here: https://sablierapp.dev/#/plugins/caddy?id=configuration In short: jellyfin.example.org {
sablier {
group jellyfin
dynamic
}
reverse_proxy http://192.168.0.104:7601 {
header_up Host {host}
header_up X-Forwarded-Proto {scheme}
}
tls {
dns cloudflare _Q*********************VP
}
} And that's it, when accessing the url you should see a loading page. Caution I see that you do not use a docker container name for the jellyfin container If Jellyfin is not running in a container, please see the list of available providers: https://sablierapp.dev/#/providers/overview?id=available-providers If jellyfin is running on a container but on another machine, you will need to connect Sablier to the remote docker socket to be able to shut down properly jellyfin. Also, there is an issue open about Caddy + Sablier +TLS: #293 So you should maybe create another route without TLS to try first. |
Beta Was this translation helpful? Give feedback.
-
I am running jellyfin on the same server and as a docker conatiner, the caddy container is giving the following error, and is automatically restarting itself. Here are its logs
|
Beta Was this translation helpful? Give feedback.
-
this is my full Caddyfile
|
Beta Was this translation helpful? Give feedback.
-
I tried to add the line
in caddyfile like you said. and this time I don't get any errors in the caddy docker logs However when I visit the komga and jellyfin urls in the browser it doesn't start the container, instead I get this in the browser
|
Beta Was this translation helpful? Give feedback.
-
I was using the following configurations for reverse proxy. I was using a caddy image built with cloudflare plugin in the Dockerfile.
I am very beginner I tried to follow the docs of sablierapp but couldn't follow.
Can someone please guide me on what to do ? The documentation is really hard to understand, especially for beginners. There is a plugin for sablier in caddy and there is a sablier docker ? do I need to run a caddy with sablier plugin and then run the sablier container again ?? its very confusing.
Caddyfile
docker-compose.yml
Dockerfile
Beta Was this translation helpful? Give feedback.
All reactions