automatically create db and remove bd auth
This commit is contained in:
parent
d17048fcfd
commit
574a3e49da
18
README.md
18
README.md
|
|
@ -10,24 +10,6 @@ To generate the `SECRET` and `KEY`
|
|||
|
||||
`docker-compose up -d`
|
||||
|
||||
## On first launch, create the DB
|
||||
|
||||
A few troubles to run Directus with Docker on MariaDB instead of Postgresql, so we have to create the DB manually on the first launch.
|
||||
|
||||
`docker exec -it PROJECTNAME_Directus_DB /bin/bash`
|
||||
|
||||
`mariadb -u root`
|
||||
|
||||
`CREATE DATABASE directus;`
|
||||
|
||||
`GRANT ALL PRIVILEGES ON directus.* TO 'directus'@'%';`
|
||||
|
||||
`FLUSH PRIVILEGES;`
|
||||
|
||||
`exit;`
|
||||
|
||||
`exit`
|
||||
|
||||
## Import an exported DB
|
||||
|
||||
`docker cp db_export.sql PROJECTNAME_Directus_DB:/root/`
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
version: "3"
|
||||
services:
|
||||
database:
|
||||
container_name: ${PROJECT_NAME}_Directus_DB
|
||||
image: mariadb:10
|
||||
volumes:
|
||||
- ./data:/var/lib/mysql
|
||||
- ./setup.sql:/docker-entrypoint-initdb.d/setup.sql
|
||||
environment:
|
||||
- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1
|
||||
- MARIADB_USER=directus
|
||||
- MARIADB_PASSWORD=directus
|
||||
- MARIADB_USER=root
|
||||
- MARIADB_DB=directus
|
||||
|
||||
cache:
|
||||
|
|
@ -36,8 +35,8 @@ services:
|
|||
DB_HOST: "database"
|
||||
DB_PORT: "3306"
|
||||
DB_DATABASE: "directus"
|
||||
DB_USER: "directus"
|
||||
DB_PASSWORD: "directus"
|
||||
DB_USER: "root"
|
||||
DB_PASSWORD: ""
|
||||
|
||||
CACHE_ENABLED: "true"
|
||||
CACHE_STORE: "redis"
|
||||
|
|
|
|||
Loading…
Reference in New Issue