Skip to content

Commit 14b439b

Browse files
committed
Code for step 2
1 parent 2b9df61 commit 14b439b

3 files changed

Lines changed: 131 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version: '3.7'
2+
3+
services:
4+
auto_finder_app:
5+
image: elixir:1.10.2
6+
command: >
7+
/bin/sh -c 'apt-get update && apt-get install -y inotify-tools &&
8+
mix local.hex --force &&
9+
mix local.rebar --force &&
10+
mix deps.get &&
11+
mix ecto.setup &&
12+
mix phx.server'
13+
ports:
14+
- '4000:4000'
15+
depends_on:
16+
- loki
17+
- postgres
18+
working_dir: /app
19+
logging:
20+
driver: loki
21+
options:
22+
loki-url: 'http://loki:loki@localhost:3100/loki/api/v1/push'
23+
volumes:
24+
- ./config:/app/config:ro
25+
- ./lib:/app/lib:ro
26+
- ./priv:/app/priv:ro
27+
- ./mix.exs:/app/mix.exs:ro
28+
- ./mix.lock:/app/mix.lock:rw
29+
- elixir-deps:/app/deps/
30+
- elixir-build:/app/_build/
31+
32+
postgres:
33+
image: postgres:12.2
34+
ports:
35+
- '5432:5432'
36+
volumes:
37+
- postgres-data:/var/lib/postgresql/data
38+
environment:
39+
POSTGRES_PASSWORD: postgres
40+
POSTGRES_USER: postgres
41+
42+
loki:
43+
image: grafana/loki:master-f106c09
44+
volumes:
45+
- ./docker/loki/loki-config.yml:/etc/loki/loki-config.yml
46+
- loki-data-index:/loki-index
47+
- loki-data-chunks:/loki-chunks
48+
expose:
49+
- 3100
50+
ports:
51+
- '3100:3100'
52+
command: '-config.file=/etc/loki/loki-config.yml'
53+
54+
grafana:
55+
image: grafana/grafana:6.6.2
56+
ports:
57+
- '3000:3000'
58+
volumes:
59+
- grafana-data:/var/lib/grafana
60+
- ./docker/grafana/:/etc/grafana/provisioning/
61+
62+
volumes:
63+
elixir-deps: {}
64+
elixir-build: {}
65+
postgres-data: {}
66+
loki-data-index: {}
67+
loki-data-chunks: {}
68+
grafana-data: {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# config file version
2+
apiVersion: 1
3+
4+
datasources:
5+
- name: loki
6+
type: loki
7+
access: proxy
8+
url: http://loki:3100
9+
editable: false

docker/loki/loki-config.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
auth_enabled: false
2+
3+
server:
4+
http_listen_port: 3100
5+
6+
ingester:
7+
lifecycler:
8+
address: 127.0.0.1
9+
ring:
10+
kvstore:
11+
store: inmemory
12+
replication_factor: 1
13+
final_sleep: 0s
14+
chunk_idle_period: 5m
15+
chunk_retain_period: 30s
16+
17+
schema_config:
18+
configs:
19+
- from: 2018-04-15
20+
store: boltdb
21+
object_store: filesystem
22+
schema: v9
23+
index:
24+
prefix: index_
25+
period: 168h
26+
27+
storage_config:
28+
boltdb:
29+
directory: /loki-index
30+
31+
filesystem:
32+
directory: /loki-chunks
33+
34+
limits_config:
35+
enforce_metric_name: false
36+
reject_old_samples: true
37+
reject_old_samples_max_age: 168h
38+
39+
chunk_store_config:
40+
max_look_back_period: 0
41+
42+
table_manager:
43+
chunk_tables_provisioning:
44+
inactive_read_throughput: 0
45+
inactive_write_throughput: 0
46+
provisioned_read_throughput: 0
47+
provisioned_write_throughput: 0
48+
index_tables_provisioning:
49+
inactive_read_throughput: 0
50+
inactive_write_throughput: 0
51+
provisioned_read_throughput: 0
52+
provisioned_write_throughput: 0
53+
retention_deletes_enabled: false
54+
retention_period: 0

0 commit comments

Comments
 (0)