From 36751a2b6700955c52a4d17cc2630b22cd119ba3 Mon Sep 17 00:00:00 2001 From: Rohit Amarnath <88762+ramarnat@users.noreply.github.com> Date: Wed, 28 Jan 2026 11:47:55 -0500 Subject: [PATCH] self-hosting: add print services (CUPS + watcher) Adds print-server (CUPS+Avahi via macvlan) and print-watcher services, plus a dedicated print-watcher env template. Also fixes self-build compose env_file paths to reference ../.env. --- .../docker-compose/docker-compose.yml | 43 +++++++++++++ .../docker-compose/print-watcher/.env.example | 5 ++ .../self-build/docker-compose.yml | 63 ++++++++++++++++--- 3 files changed, 101 insertions(+), 10 deletions(-) create mode 100644 self-hosting/docker-compose/print-watcher/.env.example diff --git a/self-hosting/docker-compose/docker-compose.yml b/self-hosting/docker-compose/docker-compose.yml index 8df9b1209..b155937f8 100644 --- a/self-hosting/docker-compose/docker-compose.yml +++ b/self-hosting/docker-compose/docker-compose.yml @@ -153,8 +153,51 @@ services: condition: service_healthy restart: always + print-server: + profiles: ["print"] + build: + context: ../../packages/print/ippserver + dockerfile: Dockerfile + container_name: "omnivore-print-server" + hostname: "omnivore-print" + networks: + print_mdns: + ipv4_address: ${PRINT_SERVER_IP:-10.0.1.250} + volumes: + - print_spool:/spool + restart: unless-stopped + + print-watcher: + profiles: ["print"] + build: + context: ../../packages/print/watcher + dockerfile: Dockerfile + container_name: "omnivore-print-watcher" + env_file: + - ./print-watcher/.env + environment: + - OMNIVORE_GRAPHQL_ENDPOINT=http://api:8080/api/graphql + volumes: + - print_spool:/spool + depends_on: + api: + condition: service_healthy + restart: unless-stopped + volumes: pgdata: redis_data: minio_data: + print_spool: +networks: + # For Bonjour/mDNS discovery without binding host UDP 5353, the print server + # runs on its own LAN IP via macvlan. + print_mdns: + driver: macvlan + driver_opts: + parent: ${PRINT_MACVLAN_PARENT:-eth0} + ipam: + config: + - subnet: ${PRINT_MACVLAN_SUBNET:-10.0.1.0/24} + gateway: ${PRINT_MACVLAN_GATEWAY:-10.0.1.1} diff --git a/self-hosting/docker-compose/print-watcher/.env.example b/self-hosting/docker-compose/print-watcher/.env.example new file mode 100644 index 000000000..cafd06b6a --- /dev/null +++ b/self-hosting/docker-compose/print-watcher/.env.example @@ -0,0 +1,5 @@ +# Only used by the print watcher container (not the rest of the stack). +OMNIVORE_API_KEY=your-api-key-here + +# Optional override: +# OMNIVORE_GRAPHQL_ENDPOINT=http://api:8080/api/graphql diff --git a/self-hosting/docker-compose/self-build/docker-compose.yml b/self-hosting/docker-compose/self-build/docker-compose.yml index 12afb8eb9..91b06ad3b 100644 --- a/self-hosting/docker-compose/self-build/docker-compose.yml +++ b/self-hosting/docker-compose/self-build/docker-compose.yml @@ -1,6 +1,6 @@ version: '3' -x-postgres: - &postgres-common + +x-postgres: &postgres-common image: "ankane/pgvector:v0.5.1" user: postgres healthcheck: @@ -18,7 +18,7 @@ services: volumes: - pgdata:/var/lib/postgresql/data env_file: - - .env + - ../.env migrate: build: @@ -27,7 +27,7 @@ services: container_name: "omnivore-migrate" command: '/bin/sh ./packages/db/setup.sh' # Also create a demo user with email: demo@omnivore.app, password: demo_password env_file: - - .env + - ../.env depends_on: postgres: condition: service_healthy @@ -45,7 +45,7 @@ services: timeout: 90s retries: 6 env_file: - - .env + - ../.env depends_on: migrate: condition: service_completed_successfully @@ -56,7 +56,7 @@ services: dockerfile: ./packages/api/queue-processor/Dockerfile container_name: "omnivore-queue-processor" env_file: - - .env + - ../.env depends_on: api: condition: service_started @@ -75,7 +75,7 @@ services: ports: - "3000:8080" env_file: - .env + - ../.env depends_on: api: condition: service_healthy @@ -88,7 +88,7 @@ services: ports: - "7070:8080" env_file: - - .env + - ../.env content-fetch: build: @@ -100,7 +100,7 @@ services: environment: - USE_FIREFOX=true # Using Firefox here because the official chrome version seems to freeze a lot in Docker. env_file: - - .env + - ../.env depends_on: redis: condition: service_healthy @@ -155,6 +155,7 @@ services: /usr/bin/mc policy set public myminio/omnivore; exit 0; " + mail-watch-server: build: context: ../../../ @@ -163,14 +164,56 @@ services: ports: - "4398:8080" env_file: - - .env + - ../.env depends_on: redis: condition: service_healthy + print-server: + profiles: ["print"] + build: + context: ../../../packages/print/ippserver + dockerfile: Dockerfile + container_name: "omnivore-print-server" + hostname: "omnivore-print" + networks: + print_mdns: + ipv4_address: ${PRINT_SERVER_IP:-10.0.1.250} + volumes: + - print_spool:/spool + restart: unless-stopped + + print-watcher: + profiles: ["print"] + build: + context: ../../../packages/print/watcher + dockerfile: Dockerfile + container_name: "omnivore-print-watcher" + env_file: + - ../print-watcher/.env + environment: + - OMNIVORE_GRAPHQL_ENDPOINT=http://api:8080/api/graphql + volumes: + - print_spool:/spool + depends_on: + api: + condition: service_healthy + restart: unless-stopped volumes: pgdata: redis_data: minio_data: + print_spool: +networks: + # For Bonjour/mDNS discovery without binding host UDP 5353, the print server + # runs on its own LAN IP via macvlan. + print_mdns: + driver: macvlan + driver_opts: + parent: ${PRINT_MACVLAN_PARENT:-eth0} + ipam: + config: + - subnet: ${PRINT_MACVLAN_SUBNET:-10.0.1.0/24} + gateway: ${PRINT_MACVLAN_GATEWAY:-10.0.1.1}