diff --git a/.env.example b/.env.example index dc2d9a0..8eb778b 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,4 @@ KEY= SECRET= ADMIN_EMAIL= ADMIN_PASSWORD= -PORT= +PORT= \ No newline at end of file diff --git a/README.md b/README.md index 59f126d..863b30d 100644 --- a/README.md +++ b/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/` diff --git a/docker-compose.yml b/docker-compose.yml index 00c6100..4f9f17f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" @@ -51,4 +50,4 @@ services: CORS_ENABLED: true CORS_ORIGIN: true - CACHE_AUTO_PURGE: true + CACHE_AUTO_PURGE: true \ No newline at end of file