Add Varnish caching layer for OpenRuntimes executor

This commit is contained in:
Torsten Dittmann
2025-05-18 17:42:43 +02:00
parent 65964e358c
commit 0f3b7db699
3 changed files with 34 additions and 3 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ _APP_COMPUTE_INACTIVE_THRESHOLD=600
_APP_COMPUTE_MAINTENANCE_INTERVAL=600
_APP_COMPUTE_RUNTIMES_NETWORK=runtimes
_APP_EXECUTOR_SECRET=your-secret-key
_APP_EXECUTOR_HOST=http://exc1/v1
_APP_EXECUTOR_HOST=http://fastly/v1
_APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1
_APP_SITES_RUNTIMES=static-1,node-22,flutter-3.29
_APP_MAINTENANCE_INTERVAL=86400
+22 -2
View File
@@ -946,12 +946,32 @@ services:
networks:
- appwrite
fastly:
image: varnish:7.7.1
container_name: fastly
hostname: fastly
ports:
- 1337:80
volumes:
- ./varnish.vcl:/etc/varnish/default.vcl:ro
networks:
- appwrite
- runtimes
depends_on:
- openruntimes-executor
command: >
varnishd
-F
-f /etc/varnish/default.vcl
-a :80
-s malloc,256m
openruntimes-executor:
container_name: openruntimes-executor
hostname: exc1
<<: *x-logging
stop_signal: SIGINT
image: openruntimes/executor:0.7.15-streaming-1
image: executor-openruntimes-executor:latest
restart: unless-stopped
networks:
- appwrite
@@ -1015,7 +1035,7 @@ services:
- OPR_PROXY_SECRET=$_APP_EXECUTOR_SECRET
- OPR_PROXY_LOGGING_CONFIG=$_APP_LOGGING_CONFIG
- OPR_PROXY_ALGORITHM=random
- OPR_PROXY_EXECUTORS=exc1
- OPR_PROXY_EXECUTORS=fastly
- OPR_PROXY_HEALTHCHECK_INTERVAL=10000
- OPR_PROXY_MAX_TIMEOUT=600
- OPR_PROXY_HEALTHCHECK=enabled
+11
View File
@@ -0,0 +1,11 @@
vcl 4.1;
backend exc1 {
.host = "exc1";
.port = "80";
.first_byte_timeout = 10s;
}
sub vcl_recv {
set req.backend_hint = exc1;
}