summaryrefslogtreecommitdiffhomepage
path: root/public/v4/apps/directus-mysql-redis.yml
blob: d57953ddd916f850c04aee8d215df47ade0e5379 (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
captainVersion: 4

services:
    # MySQL
    $$cap_appname-mysql:
        image: mysql:$$cap_mysql_tag
        volumes:
            - $$cap_appname-data:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: $$cap_mysql_root_password
            MYSQL_USER: $$cap_mysql_user
            MYSQL_PASSWORD: $$cap_mysql_password
            MYSQL_DATABASE: $$cap_mysql_database_name
        caproverExtra:
            notExposeAsWebApp: 'true'

    # Redis
    $$cap_appname-redis:
        image: redis:$$cap_redis_tag
        caproverExtra:
            notExposeAsWebApp: 'true'

    # Directus
    $$cap_appname:
        depends_on:
            - $$cap_appname-mysql
            - $$cap_appname-redis
        image: directus/directus:$$cap_directus_tag
        volumes:
            - $$cap_appname-uploads:/directus/uploads
            - $$cap_appname-extensions:/directus/extensions
        restart: always
        environment:
            KEY: $$cap_directus_auth_public_key
            SECRET: $$cap_directus_auth_secret_key
            PUBLIC_URL: https://$$cap_appname.$$cap_root_domain
            DB_CLIENT: 'mysql'
            DB_HOST: srv-captain--$$cap_appname-mysql
            DB_PORT: '3306'
            DB_DATABASE: $$cap_mysql_database_name
            DB_USER: $$cap_mysql_user
            DB_PASSWORD: $$cap_mysql_password
            CACHE_ENABLED: 'true'
            CACHE_STORE: 'redis'
            CACHE_AUTO_PURGE: $$cap_redis_auto_purge
            CACHE_TTL: $$cap_redis_ttl
            # Before Directus 10.4.0
            CACHE_REDIS: redis://srv-captain--$$cap_appname-redis:6379
            # Since Directus 10.4.0
            REDIS: redis://srv-captain--$$cap_appname-redis:6379
            ADMIN_EMAIL: $$cap_admin_email
            ADMIN_PASSWORD: $$cap_admin_password
            TELEMETRY: 'false'
        caproverExtra:
            containerHttpPort: '8055'

caproverOneClickApp:
    variables:
        - label: Directus image tag
          id: $$cap_directus_tag
          defaultValue: '9.22.1'
          validRegex: /.{1,}/
          description: Tag of Directus image on https://hub.docker.com/r/directus/directus/tags

        - label: Directus Auth Secret Key
          id: $$cap_directus_auth_secret_key
          defaultValue: $$cap_gen_random_hex(22)
          validRegex: /^(?=.*\d).{10,}$/
          description: Directus Auth Secret Key (must not be the same as Directus Auth Public Key)

        - label: Directus Auth Public Key
          id: $$cap_directus_auth_public_key
          defaultValue: $$cap_gen_random_hex(22)
          validRegex: /^(?=.*\d).{10,}$/
          description: Directus Auth Public Key (must not be the same as Directus Auth Secret Key)

        - label: Directus admin user email
          id: $$cap_admin_email
          defaultValue: [email protected]
          validRegex: /.{1,}/
          description: Directus admin user email

        - label: Directus admin user password
          id: $$cap_admin_password
          defaultValue: $$cap_gen_random_hex(22)
          validRegex: /^(?=.*\d).{8,}$/
          description: Directus admin user password

        - label: MySQL image tag
          id: $$cap_mysql_tag
          defaultValue: '5.7'
          validRegex: /.{1,}/
          description: 'Tag of MySQL image on https://hub.docker.com/_/mysql/tags. NOTE: Not working with MySQL version 8 or higher!'

        - label: MySQL root password
          id: $$cap_mysql_root_password
          defaultValue: $$cap_gen_random_hex(22)
          validRegex: /^(?=.*\d).{10,}$/
          description: Root password for the MySQL database instance.

        - label: MySQL database name
          id: $$cap_mysql_database_name
          defaultValue: directus
          validRegex: /.{1,}/
          description: Name of the Directus database instance.

        - label: MySQL user name
          id: $$cap_mysql_user
          defaultValue: directus
          validRegex: /.{1,}/
          description: User for the Directus database instance.

        - label: MySQL user password
          id: $$cap_mysql_password
          defaultValue: $$cap_gen_random_hex(22)
          validRegex: /^(?=.*\d).{10,}$/
          description: User password for the Directus database instance.

        - label: Redis image tag
          id: $$cap_redis_tag
          defaultValue: '7.0-alpine'
          validRegex: /.{1,}/
          description: Tag of redis image on https://hub.docker.com/_/redis/tags

        - label: Redis CACHE_AUTO_PURGE (true or false)
          id: $$cap_redis_auto_purge
          defaultValue: 'true'
          validRegex: /.{1,}/
          description: Automatically purge the data cache on create, update, and delete actions. (https://docs.directus.io/self-hosted/config-options.html#cache)

        - label: Redis CACHE_TTL
          id: $$cap_redis_ttl
          defaultValue: '1d'
          validRegex: /.{1,}/
          description: How long the data cache is persisted. (https://docs.directus.io/self-hosted/config-options.html#cache)

    instructions:
        end: >
            Your service is available at http://$$cap_appname.$$cap_root_domain after a few minutes. You should enable HTTPS. If you won’t enable HTTPS adjust the PUBLIC_URL (environmental variable) in your App Configs.
        start: >-
            Directus is an open-source headless CMS and an Open Data Platform built to democratize the database. It provides a dynamic API and intuitive Admin Panel App. For more information and available options, see https://github.com/directus or the official documentation at https://docs.directus.io

    displayName: 'Directus + MySQL + Redis'

    isOfficial: true

    description: Directus is an open-source headless CMS and an Open Data Platform built to democratize the database. It provides a dynamic API and intuitive Admin Panel App.

    documentation: Taken from https://docs.directus.io/self-hosted/docker-guide.html.