From e83b91912591aa1e1747847867599b972118e1a5 Mon Sep 17 00:00:00 2001
From: rick <rick@gnous.eu>
Date: Sat, 8 Mar 2025 12:23:03 +0100
Subject: [PATCH] add fbl13

---
 fbl13/c3nav.cfg   | 26 ++++++++++++++
 fbl13/compose.yml | 91 +++++++++++++++++++++++++++++++++++++++++++++++
 fbl13/env.example |  5 +++
 3 files changed, 122 insertions(+)
 create mode 100644 fbl13/c3nav.cfg
 create mode 100644 fbl13/compose.yml
 create mode 100644 fbl13/env.example

diff --git a/fbl13/c3nav.cfg b/fbl13/c3nav.cfg
new file mode 100644
index 0000000..c6b1427
--- /dev/null
+++ b/fbl13/c3nav.cfg
@@ -0,0 +1,26 @@
+[c3nav]
+svg_renderer=rsvg
+branding=fbl13
+user_registration=false
+
+[locale]
+languages=en,fr
+
+[django]
+allowed_hosts=127.0.0.1,localhost,c3nav-core,c3nav-tiles,furnav.gyiwr.tf
+reverse_proxy=true
+debug=false
+
+[database]
+backend=postgresql
+host=rick_psql
+name=fbl13
+user=fbl13
+password=choose-a-password
+
+[redis]
+location=redis://redis:6379/0
+
+[celery]
+broker=redis://redis:6379/1
+backend=redis://redis:6379/2
diff --git a/fbl13/compose.yml b/fbl13/compose.yml
new file mode 100644
index 0000000..a6605d3
--- /dev/null
+++ b/fbl13/compose.yml
@@ -0,0 +1,91 @@
+version: '3'
+name: fbl13
+
+x-restart-policy: &restart-policy
+  restart: unless-stopped
+x-depends_on-default: &depends_on
+  condition: service_started
+x-depends_on-healthy: &depends_on-healthy
+  condition: service_healthy
+x-healthcheck_defaults: &healthcheck_defaults
+  interval: 10s
+  timeout: 2s
+  retries: 5
+  start_period: 5s
+x-c3nav-defaults: &c3nav-defaults
+  image: ghcr.io/c3nav/c3nav:${C3NAV_TAG}
+  depends_on:
+    redis:
+      <<: *depends_on-healthy
+  volumes:
+    - type: bind
+      source: ${C3NAV_DOCKER_DATA_DIR:-./data}
+      target: /data
+      bind:
+        create_host_path: true
+x-c3nav-environment: &c3nav-environment
+  C3NAV_LOGLEVEL: info
+  C3NAV_CONFIG: /data/c3nav.cfg
+  C3NAV_DATA_DIR: /data
+  UWSGI_WORKERS: ${C3NAV_CORE_WORKERS:-2}
+
+services:
+  c3nav-core:
+    <<: [*restart-policy, *c3nav-defaults]
+    command: webstatic-async
+    environment:
+      <<: *c3nav-environment
+      C3NAV_AUTOMIGRATE: yes
+    env_file:
+      - .env
+    healthcheck:
+      <<: *healthcheck_defaults
+      test: curl -f http://localhost:8000/
+    ports:
+      - "31025:8000"
+    networks:
+      - fbl13
+      - rick_db
+
+  c3nav-workers:
+    <<: [*restart-policy, *c3nav-defaults]
+    command: worker
+    environment:
+      <<: *c3nav-environment
+      C3NAV_AUTOMIGRATE: no
+    healthcheck:
+      interval: 30s
+      timeout: 15s
+      retries: 2
+      start_period: 5s
+      test: entrypoint worker_healthcheck
+    networks:
+      - fbl13
+      - rick_db
+
+  redis:
+    <<: *restart-policy
+    image: redis:7.2
+    command: redis-server --save 60 1 --loglevel warning
+    healthcheck:
+      <<: *healthcheck_defaults
+      test: redis-cli ping
+    volumes:
+      - "fbl13:/data"
+    ulimits:
+      nofile:
+        soft: 10032
+        hard: 10032
+    networks:
+      - fbl13
+
+volumes:
+  fbl13:
+    external: true
+
+networks:
+  rick_db:
+    name: rick_db
+    external: true
+  fbl13:
+    driver: bridge
diff --git a/fbl13/env.example b/fbl13/env.example
new file mode 100644
index 0000000..e361e14
--- /dev/null
+++ b/fbl13/env.example
@@ -0,0 +1,5 @@
+C3NAV_TAG=8a9cdf1ce88c20a400b1720d75fb0aa08be29519
+C3NAV_DOMAIN=c3nav.docker.localhost
+# if you want to change the default path to the data dir, which by default is a folder called data in this directory
+#C3NAV_DOCKER_DATA_DIR=/opt/fbl13/data
+C3NAV_DOCKER_DATA_DIR=/home/rick/projets/infra/vps/fbl13/data