forked from plausible/analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-geoip.yml
91 lines (85 loc) · 2.38 KB
/
docker-compose-geoip.yml
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
# NOTE:
# This Docker-compose file is created as a sample and should not be used directly for production
# You can adjust the settings as-per your environment
version: "3.3"
services:
# As it says, this service is a fake smtp server which accepts SMTP connections
# the inbox is available at localhost:8025, in actuality, you need to use a proper smtp server
fake_smtp:
image: mailhog/mailhog:v1.0.0
ports:
- 1025:1025
- 8025:8025
healthcheck:
test: echo | telnet 127.0.0.1 1025
plausible_db:
image: postgres:12
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=plausible_db
- POSTGRES_USER=postgres
ports:
- 5432:5432
plausible_events_db:
image: yandex/clickhouse-server:latest
volumes:
- event-data:/var/lib/clickhouse
ports:
- 8123:8123
# optional, if you want to setup a geoip database and let it update automatically
# this requires an account at maxmind.com (https://www.maxmind.com/en/geolite2/signup)
geoip:
image: maxmindinc/geoipupdate
environment:
- GEOIPUPDATE_ACCOUNT_ID=<your-account-id>
- GEOIPUPDATE_LICENSE_KEY=<your-license-key>
- GEOIPUPDATE_EDITION_IDS=GeoLite2-Country
# update every 7 days
- GEOIPUPDATE_FREQUENCY=168
volumes:
- geoip:/usr/share/GeoIP
plausible:
build:
context: .
dockerfile: ./Dockerfile
command: sh -c "sleep 10 && /entrypoint.sh db migrate && /entrypoint.sh run"
depends_on:
- plausible_db
- plausible_events_db
- fake_smtp
ports:
- 80:8080
links:
- plausible_db
- plausible_events_db
- fake_smtp
env_file:
- plausible-variables.sample.env
# only if you use the geioip container
volumes:
- geoip:/geoip:ro
environment:
-
setup:
build:
context: .
dockerfile: ./Dockerfile
command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh db init-admin"
depends_on:
- plausible_db
- plausible_events_db
links:
- plausible_db
- plausible_events_db
env_file:
- plausible-variables.sample.env
volumes:
db-data:
driver: local
event-data:
driver: local
geoip:
driver: local