From 8efef02615e0f748b13754d9013473f78b7cea77 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Wed, 22 May 2024 20:25:08 +0100 Subject: [PATCH] build: add cloudflare tunnel config to contrib --- Justfile | 6 ++++ .../tunnel/fmtm}/docker-compose.yml | 32 ++++--------------- contrib/tunnel/odk/docker-compose.yml | 31 ++++++++++++++++++ 3 files changed, 44 insertions(+), 25 deletions(-) rename {observability/openobserve => contrib/tunnel/fmtm}/docker-compose.yml (52%) create mode 100644 contrib/tunnel/odk/docker-compose.yml diff --git a/Justfile b/Justfile index 3b81c6e158..6e287a87a2 100644 --- a/Justfile +++ b/Justfile @@ -39,6 +39,12 @@ run-with-josm: -f docker-compose.yml \ -f contrib/josm/docker-compose.yml \ up -d + +run-with-tunnels: + docker compose \ + -f docker-compose.yml \ + -f contrib/tunnel/fmtm/docker-compose.yml \ + -f contrib/tunnel/odk/docker-compose.yml \ up -d stop: diff --git a/observability/openobserve/docker-compose.yml b/contrib/tunnel/fmtm/docker-compose.yml similarity index 52% rename from observability/openobserve/docker-compose.yml rename to contrib/tunnel/fmtm/docker-compose.yml index 1595fc6c90..bdd0aa7eff 100644 --- a/observability/openobserve/docker-compose.yml +++ b/contrib/tunnel/fmtm/docker-compose.yml @@ -15,35 +15,17 @@ # along with FMTM. If not, see . # -volumes: - fmtm_monitoring_data: - name: fmtm-monitoring-data-${GIT_BRANCH:-local} - networks: fmtm-net: name: fmtm-${GIT_BRANCH:-local} services: - openobserve: - image: public.ecr.aws/zinclabs/openobserve:latest - environment: - ZO_ROOT_USER_EMAIL: ${OPENOBSERVE_USER} - ZO_ROOT_USER_PASSWORD: ${OPENOBSERVE_PASSWORD} - # Keep data 90 days - ZO_COMPACT_DATA_RETENTION_DAYS: ${OPENOBSERVE_RETENTION_DAYS} - # S3 config - # ZO_LOCAL_MODE_STORAGE: s3 - # ZO_S3_SERVER_URL: ${S3_xx} - # ZO_S3_REGION_NAME: us-west-1 - # ZO_S3_ACCESS_KEY: ${S3_xx} - # ZO_S3_SECRET_KEY: ${S3_xx} - # ZO_S3_BUCKET_NAME: ${S3_xx} - # ZO_S3_PROVIDER: s3 - ports: - - "5080:5080" - volumes: - - fmtm_monitoring_data:/data + fmtm-tunnel: + image: "docker.io/cloudflare/cloudflared:latest" + depends_on: + proxy: + condition: service_healthy networks: - fmtm-net - restart: unless-stopped - # TODO add healthcheck + restart: "unless-stopped" + command: tunnel --url http://proxy:80 diff --git a/contrib/tunnel/odk/docker-compose.yml b/contrib/tunnel/odk/docker-compose.yml new file mode 100644 index 0000000000..77b7734197 --- /dev/null +++ b/contrib/tunnel/odk/docker-compose.yml @@ -0,0 +1,31 @@ +# Copyright (c) 2022, 2023 Humanitarian OpenStreetMap Team +# This file is part of FMTM. +# +# FMTM is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# FMTM is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with FMTM. If not, see . +# + +networks: + fmtm-net: + name: fmtm-${GIT_BRANCH:-local} + +services: + central-tunnel: + image: "docker.io/cloudflare/cloudflared:latest" + depends_on: + central: + condition: service_healthy + networks: + - fmtm-net + restart: "unless-stopped" + command: tunnel --url http://central:8383