summaryrefslogtreecommitdiffstats
path: root/plausible/docker-compose.yml
blob: 3f2a414f02cb895824575ee3c9f200aa7b94dfa7 (plain) (blame)
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
version: "3.3"
services:

  geoip:
    image: maxmindinc/geoipupdate
    restart: always
    environment:
      - 'GEOIPUPDATE_EDITION_IDS=GeoLite2-City GeoLite2-Country'
      - 'GEOIPUPDATE_FREQUENCY=72'
    env_file:
      - ./GeoIP/geoip.conf
    volumes:
      - ./GeoIP:/usr/share/GeoIP

  plausible_db:
    image: postgres:14-alpine
    restart: always
    volumes:
      - ./db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=postgres

  plausible_events_db:
    image: clickhouse/clickhouse-server:22.6-alpine
    restart: always
    volumes:
      - ./clickhouse/data:/var/lib/clickhouse
      - ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro
      - ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro
    ulimits:
      nofile:
        soft: 262144
        hard: 262144

  plausible:
    image: plausible/analytics:latest
    restart: always
    command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
    depends_on:
      - plausible_db
      - plausible_events_db
      - geoip
    ports:
      - "127.0.0.1:8000:8000"
    env_file:
      - ./plausible-conf.env
    environment:
      - TZ=Asia/Shanghai
    volumes:
      - ./GeoIP:/geoip:ro
      - ./GeoIP/geonames.csv:/etc/app/geonames.csv:ro
      - ./GeoIP/GeoLite2-City.mmdb:/etc/app/GeoLite2-City.mmdb:ro 
      - ./GeoIP/GeoLite2-Country.mmdb:/etc/app/GeoLite2-Country.mmdb:ro