Update directus (#430)
This commit is contained in:
parent
9293d8e460
commit
479b041be1
|
|
@ -1,105 +1,99 @@
|
|||
captainVersion: 4
|
||||
services:
|
||||
$$cap_appname-db:
|
||||
image: mysql:5.7
|
||||
# Postgres
|
||||
$$cap_appname-postgres:
|
||||
image: postgres:13
|
||||
volumes:
|
||||
- $$cap_appname-db-data:/var/lib/mysql/
|
||||
- $$cap_appname-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
MYSQL_DATABASE: $$cap_mysql_database_name
|
||||
MYSQL_ROOT_PASSWORD: $$cap_mysql_root_passwd
|
||||
MYSQL_USER: $$cap_mysql_user
|
||||
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
|
||||
POSTGRES_DB: $$cap_postgres_database_name
|
||||
POSTGRES_USER: $$cap_postgres_user
|
||||
POSTGRES_PASSWORD: $$cap_postgres_passwd
|
||||
caproverExtra:
|
||||
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:
|
||||
$$cap_appname-db:
|
||||
condition: service_healthy
|
||||
- $$cap_appname-postgres
|
||||
- $$cap_appname-redis
|
||||
image: directus/directus:$$cap_directus_tag
|
||||
volumes:
|
||||
- $$cap_appname-directus-uploads:/var/directus/public/uploads
|
||||
- $$cap_appname-uploads:/directus/uploads
|
||||
- $$cap_appname-extensions:/directus/extensions
|
||||
restart: always
|
||||
environment:
|
||||
DIRECTUS_DATABASE_HOST: srv-captain--$$cap_appname-db
|
||||
DIRECTUS_DATABASE_NAME: $$cap_mysql_database_name
|
||||
DIRECTUS_DATABASE_USERNAME: $$cap_mysql_user
|
||||
DIRECTUS_DATABASE_PASSWORD: $$cap_mysql_passwd
|
||||
DIRECTUS_AUTH_SECRETKEY: $$cap_directus_auth_secret_key
|
||||
DIRECTUS_AUTH_PUBLICKEY: $$cap_directus_auth_public_key
|
||||
KEY: $$cap_directus_auth_public_key
|
||||
SECRET: $$cap_directus_auth_secret_key
|
||||
DB_CLIENT: 'pg'
|
||||
DB_HOST: srv-captain--$$cap_appname-postgres
|
||||
DB_PORT: '5432'
|
||||
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:
|
||||
variables:
|
||||
- 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
|
||||
label: Directus image tag
|
||||
validRegex: /.{1,}/
|
||||
- description: Name of the Directus backing database instance.
|
||||
- description: Name of the Directus database instance.
|
||||
defaultValue: directus
|
||||
id: $$cap_mysql_database_name
|
||||
label: mySQL Database Name
|
||||
id: $$cap_postgres_database_name
|
||||
label: Postgres database name
|
||||
validRegex: /.{1,}/
|
||||
- description: Master password for the Directus backing database instance.
|
||||
defaultValue: L4fCizKUZtX4Htwi
|
||||
id: $$cap_mysql_root_passwd
|
||||
label: mySQL Root Password
|
||||
validRegex: /^(?=.*\d).{10,}$/
|
||||
- description: User for the Directus backing database instance.
|
||||
- description: User for the Directus database instance.
|
||||
defaultValue: directus
|
||||
id: $$cap_mysql_user
|
||||
label: mySQL User
|
||||
id: $$cap_postgres_user
|
||||
label: Postgres user
|
||||
validRegex: /.{1,}/
|
||||
- description: User password for the Directus backing database instance.
|
||||
defaultValue: N2cQ4J9VzsfvXwzM
|
||||
id: $$cap_mysql_passwd
|
||||
label: mySQL User Password
|
||||
- description: User password for the Directus database instance.
|
||||
defaultValue: $$cap_gen_random_hex(16)
|
||||
id: $$cap_postgres_passwd
|
||||
label: Postgres user password
|
||||
validRegex: /^(?=.*\d).{10,}$/
|
||||
- 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
|
||||
label: Directus Auth Secret Key
|
||||
validRegex: /^(?=.*\d).{10,}$/
|
||||
- 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
|
||||
label: Directus Auth Public Key
|
||||
validRegex: /^(?=.*\d).{10,}$/
|
||||
- description: Directus admin user email
|
||||
defaultValue: admin@example.com
|
||||
id: $$cap_directus_install_email
|
||||
id: $$cap_admin_email
|
||||
label: Directus admin user email
|
||||
validRegex: /.{1,}/
|
||||
- description: Directus admin user password
|
||||
defaultValue: yM7iT3ijt95pyeJP
|
||||
id: $$cap_directus_install_password
|
||||
defaultValue: $$cap_gen_random_hex(8)
|
||||
id: $$cap_admin_password
|
||||
label: Directus admin user password
|
||||
validRegex: /^(?=.*\d).{10,}$/
|
||||
validRegex: /^(?=.*\d).{8,}$/
|
||||
instructions:
|
||||
end: >
|
||||
THE INSTALLATION PROCESS IS NOT FINISHED !!!
|
||||
|
||||
|
||||
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.
|
||||
Aaaand you're done! 😄
|
||||
Your service is available at http://$$cap_appname.$$cap_root_domain
|
||||
start: >-
|
||||
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
|
||||
displayName: ''
|
||||
displayName: 'Directus'
|
||||
isOfficial: true
|
||||
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