diff --git a/docker-stacks/app-server/penpot.yml b/docker-stacks/app-server/penpot.yml index 527d5ca..386cd68 100644 --- a/docker-stacks/app-server/penpot.yml +++ b/docker-stacks/app-server/penpot.yml @@ -18,7 +18,7 @@ networks: volumes: penpot_assets: - penpot_postgres_v15: # Added to persist your local database tables across container restarts + penpot_postgres_v15: services: penpot-frontend: @@ -48,7 +48,9 @@ services: - "6060:6060" depends_on: penpot-postgres: - condition: service_healthy # Binds initialization order to a healthy local database + condition: service_healthy # Wait for database stability + penpot-valkey: + condition: service_healthy # Wait for internal caching layer stability environment: << : [*penpot-flags, *penpot-public-uri, *penpot-http-body-size, *penpot-secret-key] @@ -60,8 +62,8 @@ services: PENPOT_DATABASE_USERNAME: penpot PENPOT_DATABASE_PASSWORD: penpot - ## Valkey/Redis parameters routed directly to your active k3s node - PENPOT_REDIS_URI: ${PENPOT_REDIS_URI} + ## Local Caching Layer connection parameter + PENPOT_REDIS_URI: redis://penpot-valkey/0 ## Storage Settings PENPOT_OBJECTS_STORAGE_BACKEND: fs @@ -79,7 +81,10 @@ services: penpot-exporter: image: "penpotapp/exporter:${PENPOT_VERSION:-latest}" restart: always - shm_size: '2gb' # Retained to protect Puppeteer rendering processes from memory crashes + shm_size: '2gb' # Protects Puppeteer rendering processes from memory crashes + depends_on: + penpot-valkey: + condition: service_healthy networks: - penpot-net environment: @@ -87,9 +92,9 @@ services: PENPOT_EXPORTER_SECRET_KEY: ${PENPOT_EXPORTER_SECRET_KEY} PENPOT_PUBLIC_URI: http://penpot-frontend:8080 - ## Valkey/Redis variables duplicated to satisfy background exporter sub-engines - PENPOT_REDIS_URI: ${PENPOT_REDIS_URI} - PENPOT_REDIS_URL: ${PENPOT_REDIS_URI} + ## Local Caching Layer connections for the exporter sub-engine + PENPOT_REDIS_URI: redis://penpot-valkey/0 + PENPOT_REDIS_URL: redis://penpot-valkey/0 PENPOT_FLAGS: disable-sandbox # Integrated isolated Database Service @@ -111,4 +116,19 @@ services: interval: 2s timeout: 10s retries: 5 - start_period: 2s \ No newline at end of file + start_period: 2s + + # Integrated isolated Caching Engine (Valkey drop-in for Redis) + penpot-valkey: + image: valkey/valkey:8.1 + restart: always + networks: + - penpot-net + environment: + - VALKEY_EXTRA_FLAGS=--maxmemory 128mb --maxmemory-policy volatile-lfu + healthcheck: + test: ["CMD-SHELL", "valkey-cli ping | grep PONG"] + interval: 1s + timeout: 3s + retries: 5 + start_period: 3s \ No newline at end of file