From abe2aeceab858d6ad3a838ffe2970a0e9e2a4606 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Sat, 20 Jul 2024 16:20:13 -0500 Subject: Initial commit --- templates/tracker-compose.yml.j2 | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 templates/tracker-compose.yml.j2 (limited to 'templates/tracker-compose.yml.j2') diff --git a/templates/tracker-compose.yml.j2 b/templates/tracker-compose.yml.j2 new file mode 100644 index 0000000..0f866d5 --- /dev/null +++ b/templates/tracker-compose.yml.j2 @@ -0,0 +1,64 @@ +services: + tracker_db: + image: postgres + restart: always + environment: +{% for key, value in tracker_env.items() %} + - {{ key }}={{ value }} +{% endfor %} + + volumes: + - ./data/tracker_db:/var/lib/postgresql/data + grafana: + image: grafana/grafana + restart: always + depends_on: + - tracker_db + environment: +{% for key, value in tracker_env.items() %} + - {{ key }}={{ value }} +{% endfor %} + + volumes: + - ./data/grafana_data:/var/lib/grafana + labels: +{% with router_name="grafana", host_prefix="grafana", container_port="3000" %} +{% include "util/traefik_labels.txt.j2" %} +{% endwith %} + + tracker: + container_name: tracker_nginx + restart: always + image: nginx + volumes: + - "./tracker-spa.git/dist/spa/:/usr/share/nginx/html" + labels: +{% with router_name="tracker", host_prefix="tracker", container_port="80" %} +{% include "util/traefik_labels.txt.j2" %} +{% endwith %} + + - traefik.http.routers.tracker.middlewares=myauth + - "traefik.http.middlewares.myauth.basicauth.users={{auth_string}}" + postgrest: + image: postgrest/postgrest + restart: always + environment: +{% for key, value in tracker_env.items() %} + - {{ key }}={{ value }} +{% endfor %} + + depends_on: + - tracker_db + labels: +{% with router_name="postgrest", host_prefix="postgrest", container_port="3000" %} +{% include "util/traefik_labels.txt.j2" %} +{% endwith %} + + - traefik.http.routers.postgrest.middlewares=corsheader,postgrest-auth + - "traefik.http.middlewares.postgrest-auth.basicauth.users={{auth_string}}" + - "traefik.http.middlewares.corsheader.headers.accesscontrolallowmethods=*" + - "traefik.http.middlewares.corsheader.headers.accesscontrolallowheaders=*" + - "traefik.http.middlewares.corsheader.headers.accesscontrolalloworiginlist=https://tracker.{{host}}" + - "traefik.http.middlewares.corsheader.headers.accesscontrolmaxage=100" + - "traefik.http.middlewares.corsheader.headers.addvaryheader=true" + -- cgit v1.2.3