File size: 4,142 Bytes
6380833
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# please use port numbers in the 40000 range so that it doesn't conflict with the main dev environment
x-openmeter-worker-healthcheck: &openmeter-worker-healthcheck
  test: ["CMD", "wget", "--spider", "http://localhost:10000/healthz"]
  interval: 5s
  timeout: 3s
  retries: 30

services:
  openmeter:
    image: ghcr.io/openmeterio/openmeter:latest
    command: openmeter --address 0.0.0.0:8888 --config /etc/openmeter/config.yaml
    restart: always
    pull_policy: always
    depends_on:
      kafka:
        condition: service_healthy
      clickhouse:
        condition: service_healthy
      postgres:
        condition: service_healthy
    ports:
      - "127.0.0.1:48888:8888"
    volumes:
      - ./config.yaml:/etc/openmeter/config.yaml
    healthcheck:
      test: ["CMD", "wget", "--spider", "http://openmeter:8888/api/v1/debug/metrics"]
      interval: 5s
      timeout: 3s
      retries: 30

  sink-worker:
    image: ghcr.io/openmeterio/openmeter:latest
    command: openmeter-sink-worker --config /etc/openmeter/config.yaml
    restart: always
    pull_policy: always
    depends_on:
      kafka:
        condition: service_healthy
      clickhouse:
        condition: service_healthy
      openmeter:
        condition: service_healthy
      redis:
        condition: service_healthy
    ports:
      - "127.0.0.1:40000:10000"
    volumes:
      - ./config.yaml:/etc/openmeter/config.yaml
    healthcheck: *openmeter-worker-healthcheck

  balance-worker:
    image: ghcr.io/openmeterio/openmeter:latest
    command: openmeter-balance-worker --config /etc/openmeter/config.yaml
    restart: always
    pull_policy: always
    depends_on:
      kafka:
        condition: service_healthy
      clickhouse:
        condition: service_healthy
      openmeter:
        condition: service_healthy
      redis:
        condition: service_healthy
    ports:
      - "127.0.0.1:40001:10000"
    volumes:
      - ./config.yaml:/etc/openmeter/config.yaml
    healthcheck: *openmeter-worker-healthcheck

  notification-service:
    image: ghcr.io/openmeterio/openmeter:latest
    command: openmeter-notification-service --config /etc/openmeter/config.yaml
    restart: always
    pull_policy: always
    depends_on:
      kafka:
        condition: service_healthy
      clickhouse:
        condition: service_healthy
      openmeter:
        condition: service_healthy
    ports:
      - "127.0.0.1:40002:10000"
    volumes:
      - ./config.yaml:/etc/openmeter/config.yaml
    healthcheck: *openmeter-worker-healthcheck

  billing-worker:
    image: ghcr.io/openmeterio/openmeter:latest
    command: openmeter-billing-worker --config /etc/openmeter/config.yaml
    restart: always
    pull_policy: always
    depends_on:
      kafka:
        condition: service_healthy
      clickhouse:
        condition: service_healthy
      openmeter:
        condition: service_healthy
    ports:
      - "127.0.0.1:40003:10000"
    volumes:
      - ./config.yaml:/etc/openmeter/config.yaml
    healthcheck: *openmeter-worker-healthcheck

  openmeter-jobs:
    image: ghcr.io/openmeterio/openmeter:latest
    command: openmeter-jobs --config /etc/openmeter/config.yaml quickstart cron
    restart: always
    pull_policy: never
    depends_on:
      openmeter:
        condition: service_healthy
      kafka:
        condition: service_healthy
      clickhouse:
        condition: service_healthy
      postgres:
        condition: service_healthy
    volumes:
      - ./config.yaml:/etc/openmeter/config.yaml

  kafka:
    extends:
      file: ../docker-compose.base.yaml
      service: kafka

  clickhouse:
    extends:
      file: ../docker-compose.base.yaml
      service: clickhouse

  redis:
    extends:
      file: ../docker-compose.base.yaml
      service: redis

  postgres:
    extends:
      file: ../docker-compose.base.yaml
      service: postgres

  svix:
    extends:
      file: ../docker-compose.base.yaml
      service: svix

configs:
  svix_sql:
    content: |
      CREATE USER svix WITH PASSWORD 'svix';
      CREATE DATABASE svix;
      GRANT ALL PRIVILEGES ON DATABASE svix TO svix;
      ALTER DATABASE svix OWNER TO svix;