Update directus (#430)
This commit is contained in:
parent
9293d8e460
commit
479b041be1
|
|
@ -1,105 +1,99 @@
|
||||||
captainVersion: 4
|
captainVersion: 4
|
||||||
services:
|
services:
|
||||||
$$cap_appname-db:
|
# Postgres
|
||||||
image: mysql:5.7
|
$$cap_appname-postgres:
|
||||||
|
image: postgres:13
|
||||||
volumes:
|
volumes:
|
||||||
- $$cap_appname-db-data:/var/lib/mysql/
|
- $$cap_appname-data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
MYSQL_DATABASE: $$cap_mysql_database_name
|
POSTGRES_DB: $$cap_postgres_database_name
|
||||||
MYSQL_ROOT_PASSWORD: $$cap_mysql_root_passwd
|
POSTGRES_USER: $$cap_postgres_user
|
||||||
MYSQL_USER: $$cap_mysql_user
|
POSTGRES_PASSWORD: $$cap_postgres_passwd
|
||||||
MYSQL_PASSWORD: $$cap_mysql_passwd
|
|
||||||
healthcheck:
|
|
||||||
test: mysql -u$$cap_mysql_user -p$$cap_mysql_passwd -e "SHOW DATABASES;"
|
|
||||||
interval: 10s
|
|
||||||
timeout: 6s
|
|
||||||
retries: '10'
|
|
||||||
restart: always
|
|
||||||
caproverExtra:
|
caproverExtra:
|
||||||
notExposeAsWebApp: 'true'
|
notExposeAsWebApp: 'true'
|
||||||
$$cap_appname-directus:
|
# Cache
|
||||||
|
$$cap_appname-redis:
|
||||||
|
image: redis:6
|
||||||
|
volumes:
|
||||||
|
- $$cap_appname-redis:/data
|
||||||
|
caproverExtra:
|
||||||
|
notExposeAsWebApp: 'true'
|
||||||
|
# Directus
|
||||||
|
$$cap_appname:
|
||||||
depends_on:
|
depends_on:
|
||||||
$$cap_appname-db:
|
- $$cap_appname-postgres
|
||||||
condition: service_healthy
|
- $$cap_appname-redis
|
||||||
image: directus/directus:$$cap_directus_tag
|
image: directus/directus:$$cap_directus_tag
|
||||||
volumes:
|
volumes:
|
||||||
- $$cap_appname-directus-uploads:/var/directus/public/uploads
|
- $$cap_appname-uploads:/directus/uploads
|
||||||
|
- $$cap_appname-extensions:/directus/extensions
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
DIRECTUS_DATABASE_HOST: srv-captain--$$cap_appname-db
|
KEY: $$cap_directus_auth_public_key
|
||||||
DIRECTUS_DATABASE_NAME: $$cap_mysql_database_name
|
SECRET: $$cap_directus_auth_secret_key
|
||||||
DIRECTUS_DATABASE_USERNAME: $$cap_mysql_user
|
DB_CLIENT: 'pg'
|
||||||
DIRECTUS_DATABASE_PASSWORD: $$cap_mysql_passwd
|
DB_HOST: srv-captain--$$cap_appname-postgres
|
||||||
DIRECTUS_AUTH_SECRETKEY: $$cap_directus_auth_secret_key
|
DB_PORT: '5432'
|
||||||
DIRECTUS_AUTH_PUBLICKEY: $$cap_directus_auth_public_key
|
DB_DATABASE: $$cap_postgres_database_name
|
||||||
|
DB_USER: $$cap_postgres_user
|
||||||
|
DB_PASSWORD: $$cap_postgres_passwd
|
||||||
|
CACHE_ENABLED: 'true'
|
||||||
|
CACHE_STORE: 'redis'
|
||||||
|
CACHE_REDIS: redis://srv-captain--$$cap_appname-redis:6379
|
||||||
|
ADMIN_EMAIL: $$cap_admin_email
|
||||||
|
ADMIN_PASSWORD: $$cap_admin_password
|
||||||
|
caproverExtra:
|
||||||
|
containerHttpPort: '8055'
|
||||||
caproverOneClickApp:
|
caproverOneClickApp:
|
||||||
variables:
|
variables:
|
||||||
- description: Tag of Directus image on https://hub.docker.com/r/directus/directus/tags
|
- description: Tag of Directus image on https://hub.docker.com/r/directus/directus/tags
|
||||||
defaultValue: v8.8.0-apache
|
defaultValue: v9.0.0-rc.64
|
||||||
id: $$cap_directus_tag
|
id: $$cap_directus_tag
|
||||||
label: Directus image tag
|
label: Directus image tag
|
||||||
validRegex: /.{1,}/
|
validRegex: /.{1,}/
|
||||||
- description: Name of the Directus backing database instance.
|
- description: Name of the Directus database instance.
|
||||||
defaultValue: directus
|
defaultValue: directus
|
||||||
id: $$cap_mysql_database_name
|
id: $$cap_postgres_database_name
|
||||||
label: mySQL Database Name
|
label: Postgres database name
|
||||||
validRegex: /.{1,}/
|
validRegex: /.{1,}/
|
||||||
- description: Master password for the Directus backing database instance.
|
- description: User for the Directus database instance.
|
||||||
defaultValue: L4fCizKUZtX4Htwi
|
|
||||||
id: $$cap_mysql_root_passwd
|
|
||||||
label: mySQL Root Password
|
|
||||||
validRegex: /^(?=.*\d).{10,}$/
|
|
||||||
- description: User for the Directus backing database instance.
|
|
||||||
defaultValue: directus
|
defaultValue: directus
|
||||||
id: $$cap_mysql_user
|
id: $$cap_postgres_user
|
||||||
label: mySQL User
|
label: Postgres user
|
||||||
validRegex: /.{1,}/
|
validRegex: /.{1,}/
|
||||||
- description: User password for the Directus backing database instance.
|
- description: User password for the Directus database instance.
|
||||||
defaultValue: N2cQ4J9VzsfvXwzM
|
defaultValue: $$cap_gen_random_hex(16)
|
||||||
id: $$cap_mysql_passwd
|
id: $$cap_postgres_passwd
|
||||||
label: mySQL User Password
|
label: Postgres user password
|
||||||
validRegex: /^(?=.*\d).{10,}$/
|
validRegex: /^(?=.*\d).{10,}$/
|
||||||
- description: Directus Auth Secret Key (must not be the same as Directus Auth Public Key)
|
- description: Directus Auth Secret Key (must not be the same as Directus Auth Public Key)
|
||||||
defaultValue: nsQocnfPjh3Udjyw
|
defaultValue: $$cap_gen_random_hex(16)
|
||||||
id: $$cap_directus_auth_secret_key
|
id: $$cap_directus_auth_secret_key
|
||||||
label: Directus Auth Secret Key
|
label: Directus Auth Secret Key
|
||||||
validRegex: /^(?=.*\d).{10,}$/
|
validRegex: /^(?=.*\d).{10,}$/
|
||||||
- description: Directus Auth Public Key (must not be the same as Directus Auth Secret Key)
|
- description: Directus Auth Public Key (must not be the same as Directus Auth Secret Key)
|
||||||
defaultValue: 8QQc2mv6PXuEcsfw
|
defaultValue: $$cap_gen_random_hex(16)
|
||||||
id: $$cap_directus_auth_public_key
|
id: $$cap_directus_auth_public_key
|
||||||
label: Directus Auth Public Key
|
label: Directus Auth Public Key
|
||||||
validRegex: /^(?=.*\d).{10,}$/
|
validRegex: /^(?=.*\d).{10,}$/
|
||||||
- description: Directus admin user email
|
- description: Directus admin user email
|
||||||
defaultValue: admin@example.com
|
defaultValue: admin@example.com
|
||||||
id: $$cap_directus_install_email
|
id: $$cap_admin_email
|
||||||
label: Directus admin user email
|
label: Directus admin user email
|
||||||
validRegex: /.{1,}/
|
validRegex: /.{1,}/
|
||||||
- description: Directus admin user password
|
- description: Directus admin user password
|
||||||
defaultValue: yM7iT3ijt95pyeJP
|
defaultValue: $$cap_gen_random_hex(8)
|
||||||
id: $$cap_directus_install_password
|
id: $$cap_admin_password
|
||||||
label: Directus admin user password
|
label: Directus admin user password
|
||||||
validRegex: /^(?=.*\d).{10,}$/
|
validRegex: /^(?=.*\d).{8,}$/
|
||||||
instructions:
|
instructions:
|
||||||
end: >
|
end: >
|
||||||
THE INSTALLATION PROCESS IS NOT FINISHED !!!
|
Aaaand you're done! 😄
|
||||||
|
Your service is available at http://$$cap_appname.$$cap_root_domain
|
||||||
|
|
||||||
As said in the documentation (https://docs.directus.io/installation/docker.html#step-4-initialize-the-database-and-an-admin-user), currently (30/06/2020), Directus does not support automatic database setup so you need to do it yourself the first time you launch directus.
|
|
||||||
|
|
||||||
But since Caprover does not use standard docker-compose file, you need to run a slightly uglier command than the one shown in the documentation.
|
|
||||||
|
|
||||||
Run the following command on your server (using SSH for example, you might need to be root):
|
|
||||||
|
|
||||||
docker run -e DIRECTUS_DATABASE_HOST=srv-captain--$$cap_appname-db -e DIRECTUS_DATABASE_NAME=$$cap_mysql_database_name -e DIRECTUS_DATABASE_USERNAME=$$cap_mysql_user -e DIRECTUS_DATABASE_PASSWORD=$$cap_mysql_passwd -e DIRECTUS_AUTH_SECRETKEY=$$cap_directus_auth_secret_key -e DIRECTUS_AUTH_PUBLICKEY=$$cap_directus_auth_public_key --network $(docker network ls | grep "captain-overlay-network" | awk '{print $1}') --rm directus/directus:$$cap_directus_tag install --email $$cap_directus_install_email --password $$cap_directus_install_password
|
|
||||||
|
|
||||||
|
|
||||||
Once this is done, Directus is deployed and available as $$cap_appname-directus.
|
|
||||||
|
|
||||||
It may take a few minutes for Directus to initialize.
|
|
||||||
start: >-
|
start: >-
|
||||||
Directus is an open-source suite of software that wraps custom SQL databases with a dynamic API and intuitive Admin App.
|
Directus is an open-source suite of software that wraps custom SQL databases with a dynamic API and intuitive Admin App.
|
||||||
For more information and available options, see https://github.com/directus/docker or the official documentation at https://docs.directus.io
|
For more information and available options, see https://github.com/directus/docker or the official documentation at https://docs.directus.io
|
||||||
displayName: ''
|
displayName: 'Directus'
|
||||||
isOfficial: true
|
isOfficial: true
|
||||||
description: Directus is an open-source tool for managing content across all your omni-channel digital experiences
|
description: Directus is an open-source tool for managing content across all your omni-channel digital experiences
|
||||||
documentation: Taken from https://github.com/directus/docker.
|
documentation: Taken from https://docs.directus.io/guides/installation/docker/.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue