From 2d85ae9dd4fbc58324bf8017a08a281f5f6eb601 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 20 Aug 2023 13:26:02 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20feat(docker-compose.yml):=20upgr?= =?UTF-8?q?ade=20docker-compose=20version=20to=203.3=20for=20compatibility?= =?UTF-8?q?=20with=20newer=20features=20and=20syntax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔧 chore(docker-compose.yml): update backend.env file path to remove leading './' for consistency 🔧 chore(docker-compose.yml): remove explicit port mapping for backend service to use the default port 🔧 chore(docker-compose.yml): add deploy configuration for celery worker service to ensure only one replica is deployed 🔧 chore(docker-compose.yml): add prometheus and grafana services with necessary configurations and dependencies 📝 docs(prometheus.yml): add prometheus configuration file with scrape targets for prometheus and flower services --- deploy/docker-compose.yml | 33 +++++++++++++++++++++++++++++---- deploy/prometheus.yml | 11 +++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 deploy/prometheus.yml diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index fcdbf529b..09c994f78 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.3" services: backend: @@ -10,9 +10,9 @@ services: - queue - db env_file: - - ./backend.env + - backend.env ports: - - "7860:7860" + - "7860" volumes: - ../:/app - ./startup-backend.sh:/startup-backend.sh # Ensure the paths match @@ -58,6 +58,8 @@ services: command: celery -A langflow.worker.celery_app worker --loglevel=INFO healthcheck: test: "exit 0" + deploy: + replicas: 1 flower: # user: your-non-root-user @@ -87,9 +89,32 @@ services: depends_on: backend: condition: service_healthy - env_file: - ./frontend.env ports: - "80:80" restart: on-failure + + prometheus: + image: prom/prometheus:v2.37.9 + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + command: + - "--config.file=/etc/prometheus/prometheus.yml" + ports: + - "9090:9090" + healthcheck: + test: "exit 0" + + grafana: + image: grafana/grafana:8.2.6 + depends_on: + prometheus: + condition: service_healthy + ports: + - "3000:3000" + volumes: + - grafana_data:/var/lib/grafana + +volumes: + grafana_data: diff --git a/deploy/prometheus.yml b/deploy/prometheus.yml new file mode 100644 index 000000000..1d53d5b5f --- /dev/null +++ b/deploy/prometheus.yml @@ -0,0 +1,11 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: prometheus + static_configs: + - targets: ["prometheus:9090"] + - job_name: flower + static_configs: + - targets: ["flower:5555"]