27 lines
932 B
YAML
27 lines
932 B
YAML
# Image transformer (sharp) of every app on the VPS, at https://${SHARP_DOMAIN}/api/transformer.
|
|
# Replaces sharp.elias.systems. It only fetches sources from ALLOWED_SOURCE_HOSTS. Apps keep the
|
|
# results in their sharp/ prefix, so each image is transformed once.
|
|
services:
|
|
transformer:
|
|
image: sharp-head:0.35.4
|
|
build: .
|
|
restart: unless-stopped
|
|
# sharp runs one operation at a time; the limit protects the other stacks on this 3.8 GB host.
|
|
mem_limit: 768m
|
|
environment:
|
|
ALLOWED_SOURCE_HOSTS: ${ASSETS_DOMAIN},*.assets.bureaudouble.com
|
|
networks:
|
|
- caddy
|
|
labels:
|
|
caddy: ${SHARP_DOMAIN}
|
|
caddy.reverse_proxy: "{{upstreams 8000}}"
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8000/health').then((r) => process.exit(r.ok ? 0 : 1))"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
start_period: 10s
|
|
retries: 3
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|