summaryrefslogtreecommitdiffhomepage
path: root/public/v4/apps/plausible.yml
blob: 2460410f8b443f14efc1ff41f7c8c7239dc04c72 (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
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
captainVersion: 4

services:
    $$cap_appname-mail:
        image: bytemark/smtp
        environment:
            RELAY_HOST: $$cap_RELAY_HOST
            RELAY_PORT: $$cap_RELAY_PORT
            RELAY_USERNAME: $$cap_RELAY_USERNAME
            RELAY_PASSWORD: $$cap_RELAY_PASSWORD
        caproverExtra:
            notExposeAsWebApp: 'true'

    $$cap_appname-postgres:
        image: postgres:$$cap_POSTGRES_VERSION
        volumes:
            - $$cap_appname-postgres-data:/var/lib/postgresql/data
        environment:
            POSTGRES_USER: plausible
            POSTGRES_PASSWORD: $$cap_POSTGRES_PASSWORD
        caproverExtra:
            notExposeAsWebApp: 'true'

    $$cap_appname-clickhouse:
        image: clickhouse/clickhouse-server:$$cap_CLICKHOUSE_VERSION
        volumes:
            - $$cap_appname-clickhouse-data:/var/lib/clickhouse
        caproverExtra:
            notExposeAsWebApp: 'true'

    $$cap_appname:
        depends_on:
            - $$cap_appname-postgres
            - $$cap_appname-clickhouse
            - $$cap_appname-mail
        caproverExtra:
            containerHttpPort: '8000'
            dockerfileLines:
                - FROM plausible/analytics:$$cap_PLAUSIBLE_VERSION
                - CMD ["sh", "-c", "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"]
        environment:
            BASE_URL: http://$$cap_appname.$$cap_root_domain
            SECRET_KEY_BASE: $$cap_gen_random_hex(64)
            DATABASE_URL: postgres://plausible:$$cap_POSTGRES_PASSWORD@srv-captain--$$cap_appname-postgres:5432/plausible
            CLICKHOUSE_DATABASE_URL: http://srv-captain--$$cap_appname-clickhouse:8123/plausible
            DISABLE_REGISTRATION: 'true'
            MAILER_EMAIL: $$cap_RELAY_USERNAME
            SMTP_HOST_ADDR: srv-captain--$$cap_appname-mail
            SMTP_HOST_PORT: '25'

caproverOneClickApp:
    variables:
        - defaultValue: 'plausible'
          description: This is the PostgreSQL password for user 'plausible'. Please change it.
          id: $$cap_POSTGRES_PASSWORD
          label: POSTGRES_PASSWORD
          validRegex: /^([^\s^\/])+$/
        - defaultValue: 'smtp.mailgun.org'
          description: This is the SMTP host for sending email. Use Mailgun or whatever other service.
          id: $$cap_RELAY_HOST
          label: RELAY_HOST
          validRegex: /^([^\s^\/])+$/
        - defaultValue: '587'
          description: This is the port for the SMTP host. Please change it if needed.
          id: $$cap_RELAY_PORT
          label: RELAY_PORT
          validRegex: /^([^\s^\/])+$/
        - description: This is the username for logging into the SMTP host. Please change it according to your host.
          id: $$cap_RELAY_USERNAME
          label: RELAY_USERNAME
        - description: This is the password for logging into the SMTP host. Please change it according to your host.
          id: $$cap_RELAY_PASSWORD
          label: RELAY_PASSWORD
          validRegex: /^([^\s^\/])+$/
        - description: The version of Plausible docker image (from https://hub.docker.com/r/plausible/analytics/tags e.g. v2.0)
          id: $$cap_PLAUSIBLE_VERSION
          label: PLAUSIBLE_VERSION
          defaultValue: v2.0
          validRegex: /^([^\s^\/])+$/
        - description: Clickhouse version (from https://hub.docker.com/r/clickhouse/clickhouse-server/tags, e.g. 23.3.7.5-alpine)
          id: $$cap_CLICKHOUSE_VERSION
          label: CLICKHOUSE_VERSION
          defaultValue: 23.3.7.5-alpine
          validRegex: /^([^\s^\/])+$/
        - description: Postgres version (from https://hub.docker.com/_/postgres?tab=tags, supported versions are 12, 13, and 14)
          id: $$cap_POSTGRES_VERSION
          label: POSTGRES_VERSION
          defaultValue: 14-alpine
          validRegex: /^([^\s^\/])+$/
    instructions:
        start: >-
            Plausible is a lightweight and open-source website analytics tool.
            It doesn't use cookies and is fully compliant with GDPR, CCPA and PECR. Made and hosted in the EU.
            This one click app uses the:
            - official image from https://hub.docker.com/r/plausible/analytics
            - https://hub.docker.com/r/bytemark/smtp, that allows linked containers to send outgoing email
            - official PostgreSQL image based on Alpine Linux and
            - ClickHouse image https://hub.docker.com/r/clickhouse/clickhouse-server.
            This version includes an open source geoip database (db-ip). If you would like to use Maxmind db,
            You will need to mount a volume and an additional container to update the database. You can use this docker
            compose file for reference: https://github.com/plausible/hosting/blob/master/geoip/docker-compose.geoip.yml
        end: >-
            Plausible.io is deployed and available as $$cap_appname.
            In case you add a new domain to your application, remember to set the environment variable BASE_URL accordingly.

            See https://github.com/plausible/analytics/blob/master/config/runtime.exs for all configurable
            environment variables, for features like Google search, Postmark, and Slack integrations.

            IMPORTANT: It will take up to 2 minutes for Plausible to be ready. Before that, you might see 502 error page.
    displayName: Plausible v2
    isOfficial: false
    description: Plausible is a lightweight and open-source website analytics tool.
    documentation: Taken from https://plausible.io/.