mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-08-31 19:52:30 +00:00
@@ -8,6 +8,7 @@ members = [
|
||||
"crates/services/*",
|
||||
"crates/daemons/*",
|
||||
]
|
||||
exclude = ["crates/services/assets"]
|
||||
|
||||
[patch.crates-io]
|
||||
redis23 = { package = "redis", version = "0.23.3", git = "https://github.com/revoltchat/redis-rs", rev = "523b2937367e17bd0073722bf6e23d06042cb4e4" }
|
||||
|
||||
@@ -86,3 +86,11 @@ services:
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- ./livekit.yml:/etc/livekit.yml
|
||||
|
||||
assets:
|
||||
build: ./crates/services/assets
|
||||
ports:
|
||||
- "14707:14707"
|
||||
volumes:
|
||||
- ./assets-custom:/srv/assets/custom
|
||||
restart: unless-stopped
|
||||
35
crates/services/assets/Caddyfile
Normal file
35
crates/services/assets/Caddyfile
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
admin off
|
||||
auto_https off
|
||||
}
|
||||
|
||||
:14707 {
|
||||
encode gzip zstd
|
||||
|
||||
route {
|
||||
header Access-Control-Allow-Origin *
|
||||
header Cache-Control "public, max-age=86400"
|
||||
|
||||
respond /health 200
|
||||
|
||||
# Serve from custom/ first if the file exists there, so
|
||||
# self-hosters can add new assets or override shipped ones
|
||||
# just by dropping a file at the same relative path.
|
||||
@custom {
|
||||
file {
|
||||
root /srv/assets/custom
|
||||
try_files {http.request.uri.path}
|
||||
}
|
||||
}
|
||||
handle @custom {
|
||||
root * /srv/assets/custom
|
||||
file_server
|
||||
}
|
||||
|
||||
# Fall back to the assets baked into the image.
|
||||
handle {
|
||||
root * /srv/assets/default
|
||||
file_server
|
||||
}
|
||||
}
|
||||
}
|
||||
15
crates/services/assets/Dockerfile
Normal file
15
crates/services/assets/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM caddy:2-alpine
|
||||
|
||||
# Baked-in default assets, shipped inside the image.
|
||||
COPY default /srv/assets/default
|
||||
|
||||
# Self-hosters override this path with a volume mount to add or replace
|
||||
# assets without rebuilding the image
|
||||
COPY custom /srv/assets/custom
|
||||
|
||||
COPY Caddyfile /etc/caddy/Caddyfile
|
||||
|
||||
EXPOSE 14707
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s \
|
||||
CMD wget -qO- http://localhost:14707/health || exit 1
|
||||
Reference in New Issue
Block a user