summaryrefslogtreecommitdiffhomepage
path: root/public/v4/apps/plausible.yml
blob: 45cc8d9d51c02e1626b521af6d773896a42f9ec8 (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
captainVersion: 4

services:
    $$cap_appname-mail:
        image: bytemark/smtp
        restart: always
        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: yandex/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 db init-admin && /entrypoint.sh run"]
        environment:
            ADMIN_USER_EMAIL: $$cap_ADMIN_USER_EMAIL
            ADMIN_USER_NAME: $$cap_ADMIN_USER_NAME
            ADMIN_USER_PWD: $$cap_ADMIN_USER_PWD
            BASE_URL: http://$$cap_appname.$$cap_root_domain
            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
            SECRET_KEY_BASE: $$cap_gen_random_hex(64)
            SIGNING_SALT: $$cap_gen_random_hex(24)
            DISABLE_REGISTRATION: 'true'
            DISABLE_SUBSCRIPTION: 'true'
            MAILER_EMAIL: $$cap_RELAY_USERNAME
            SMTP_HOST_ADDR: srv-captain--$$cap_appname-mail
            SMTP_HOST_PORT: '25'

caproverOneClickApp:
    variables:
        - defaultValue: '[email protected]'
          description: This is the admin email. Please change it.
          id: $$cap_ADMIN_USER_EMAIL
          label: ADMIN_USER_EMAIL
          validRegex: /^([^\s^\/])+$/
        - defaultValue: 'admin'
          description: This is the admin username. Please change it.
          id: $$cap_ADMIN_USER_NAME
          label: ADMIN_USER_NAME
          validRegex: /^([^\s^\/])+$/
        - defaultValue: 'password'
          description: This is the admin password. Please change it.
          id: $$cap_ADMIN_USER_PWD
          label: ADMIN_USER_PWD
          validRegex: /^([^\s^\/])+$/
        - 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 eg. v1 or v1.4)
          id: $$cap_PLAUSIBLE_VERSION
          label: PLAUSIBLE_VERSION
          defaultValue: v1
          validRegex: /^([^\s^\/])+$/
        - description: Clickhouse version (from https://hub.docker.com/r/yandex/clickhouse-server/tags, eg 21.12.2.17)
          id: $$cap_CLICKHOUSE_VERSION
          label: CLICKHOUSE_VERSION
          defaultValue: 21.3.2.5
          validRegex: /^([^\s^\/])+$/
        - description: Postgres version (from https://hub.docker.com/_/postgres?tab=tags, eg 12 or 12-alpine)
          id: $$cap_POSTGRES_VERSION
          label: POSTGRES_VERSION
          defaultValue: 12-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/yandex/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
    isOfficial: false
    description: Plausible is a lightweight and open-source website analytics tool.
    documentation: Taken from https://plausible.io/.