summaryrefslogtreecommitdiff
path: root/templates/tracker-compose.yml.j2
blob: 0f866d519c9eae01f25967a2b860d6fae9b04dad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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"