147 lines
5.7 KiB
YAML
147 lines
5.7 KiB
YAML
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_REDIS: redis://srv-captain--$$cap_appname-redis:6379
|
||
CACHE_AUTO_PURGE: $$cap_redis_auto_purge
|
||
CACHE_TTL: $$cap_redis_ttl
|
||
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: admin@example.com
|
||
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.
|