create-directus-docker 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -26
- package/package.json +1 -1
- package/templates/default/README.md +2 -30
- package/templates/default/docker-compose.yml +3 -3
- package/templates/default/lib/check-requirements.js +2 -2
- package/templates/default/lib/launch-services.js +4 -0
- package/templates/default/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ The wizard will walk you through configuring your environment variables, and wil
|
|
|
29
29
|
|
|
30
30
|
Directus CMS: http://localhost:8055
|
|
31
31
|
Adminer (for MySQL): http://localhost:8080
|
|
32
|
-
GraphQL
|
|
32
|
+
Apollo GraphQL Sandbox: https://studio.apollographql.com/sandbox/explorer?endpoint=http://localhost:8055
|
|
33
33
|
|
|
34
34
|
## Seeding MySQL data
|
|
35
35
|
|
|
@@ -71,30 +71,8 @@ The helper app waits for MySQL to be ready before starting the rest of the servi
|
|
|
71
71
|
|
|
72
72
|
Simply run `docker compose ps` to see the status of running containers. Or, run `docker compose ps -a` to see all containers, running or not.
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
### Examples of getting an auth token for Directus API:
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
curl -X POST localhost:8055/auth/login -H 'Content-Type: application/json' -d '{"email":"you@email.com","password":"your-password"}'
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
1. Enable the developer menu by opening up Settings > Advanced, then check "Show Develop bar in menu"
|
|
81
|
-
2. Click the Develop menu and check "Disable Cross-Origin Restrictions"
|
|
82
|
-
|
|
83
|
-
**Chrome**
|
|
84
|
-
|
|
85
|
-
Temporarily Disable CORS in Chrome (MacOS):
|
|
86
|
-
|
|
87
|
-
1. Quit Chrome
|
|
88
|
-
2. Open terminal and run:
|
|
89
|
-
|
|
90
|
-
`open -n -a "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security`
|
|
91
|
-
|
|
92
|
-
**Windows:**
|
|
93
|
-
|
|
94
|
-
1. Right click on desktop, add new shortcut
|
|
95
|
-
2. Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp
|
|
96
|
-
3. Click OK
|
|
97
|
-
|
|
98
|
-
**Firefox:**
|
|
99
|
-
|
|
100
|
-
For Firefox you can simply install [CORS Everywhere](https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/) addon.
|
|
78
|
+
curl -X POST localhost:8055/auth/refresh -H 'Content-Type: application/json' -d '{"refresh_token": "W5L70MBXKElx5ZVZwxmQVG8qdVjukiRVIwD5FYG7tCPyyuCM_I3IyCsYnFhMUrRi", "mode": "json"}'
|
package/package.json
CHANGED
|
@@ -82,42 +82,14 @@ Then wait 10-20 seconds (for MySQL to boot), then type:
|
|
|
82
82
|
**Boom!** You're done. Now you can access the URLS from here:
|
|
83
83
|
|
|
84
84
|
Directus CMS: http://localhost:8055
|
|
85
|
-
GraphQL
|
|
85
|
+
Apollo GraphQL Sandbox: https://studio.apollographql.com/sandbox/explorer?endpoint=http://localhost:8055
|
|
86
86
|
Adminer (for MySQL): http://localhost:8080
|
|
87
87
|
|
|
88
88
|
**Check on running containers:**
|
|
89
89
|
|
|
90
90
|
Simply run `docker compose ps` to see the status of running containers. Or, run `docker compose ps -a` to see all containers, running or not.
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
When using the GraphiQL playground on localhost, you'll run into some browser problems related to CORS. Here's how to get around it:
|
|
95
|
-
|
|
96
|
-
**Safari:**
|
|
97
|
-
|
|
98
|
-
1. Enable the developer menu by opening up Settings > Advanced, then check "Show Develop bar in menu"
|
|
99
|
-
2. Click the Develop menu and check "Disable Cross-Origin Restrictions"
|
|
100
|
-
|
|
101
|
-
**Chrome**
|
|
102
|
-
|
|
103
|
-
Temporarily Disable CORS in Chrome (MacOS):
|
|
104
|
-
|
|
105
|
-
1. Quit Chrome
|
|
106
|
-
2. Open terminal and run:
|
|
107
|
-
|
|
108
|
-
`open -n -a "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security`
|
|
109
|
-
|
|
110
|
-
**Windows:**
|
|
111
|
-
|
|
112
|
-
1. Right click on desktop, add new shortcut
|
|
113
|
-
2. Add the target as "[PATH_TO_CHROME]\chrome.exe" --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp
|
|
114
|
-
3. Click OK
|
|
115
|
-
|
|
116
|
-
**Firefox:**
|
|
117
|
-
|
|
118
|
-
For Firefox you can simply install [CORS Everywhere](https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/) addon.
|
|
119
|
-
|
|
120
|
-
### Examples of getting an auth token for API:
|
|
92
|
+
### Examples of getting an auth token for Directus API:
|
|
121
93
|
|
|
122
94
|
curl -X POST localhost:8055/auth/login -H 'Content-Type: application/json' -d '{"email":"you@email.com","password":"your-password"}'
|
|
123
95
|
|
|
@@ -2,7 +2,7 @@ services:
|
|
|
2
2
|
|
|
3
3
|
mysql:
|
|
4
4
|
container_name: mysql
|
|
5
|
-
image: mysql:
|
|
5
|
+
image: mysql:9.0.1
|
|
6
6
|
restart: always
|
|
7
7
|
healthcheck:
|
|
8
8
|
test: ['CMD', 'mysqladmin', 'ping', '--silent']
|
|
@@ -17,7 +17,7 @@ services:
|
|
|
17
17
|
volumes:
|
|
18
18
|
- ./mysql:/var/lib/mysql
|
|
19
19
|
- ./init:/docker-entrypoint-initdb.d
|
|
20
|
-
command: --mysql-native-password=ON
|
|
20
|
+
# command: --mysql-native-password=ON
|
|
21
21
|
environment:
|
|
22
22
|
MYSQL_USER: ${MYSQL_USER}
|
|
23
23
|
MYSQL_PASSWORD: ${MYSQL_PASS}
|
|
@@ -55,7 +55,7 @@ services:
|
|
|
55
55
|
|
|
56
56
|
directus:
|
|
57
57
|
container_name: directus
|
|
58
|
-
image: directus/directus:
|
|
58
|
+
image: directus/directus:11.1.1
|
|
59
59
|
restart: always
|
|
60
60
|
ports:
|
|
61
61
|
- ${DIRECTUS_PORT}:8055
|
|
@@ -14,9 +14,9 @@ export default async function checkRequirements() {
|
|
|
14
14
|
process.exit(1);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
if (major <
|
|
17
|
+
if (major < 18) {
|
|
18
18
|
console.error(`You are running ${chalk.red(`Node ${nodeVersion}`)}.`);
|
|
19
|
-
console.error(`Directus requires ${chalk.green(`Node
|
|
19
|
+
console.error(`Directus requires ${chalk.green(`Node 18`)} and up.`);
|
|
20
20
|
console.error('Please update your Node version and try again.');
|
|
21
21
|
process.exit(1);
|
|
22
22
|
}
|
|
@@ -147,6 +147,10 @@ export default function launchServices() {
|
|
|
147
147
|
const check = spawn('docker', ['compose', 'ps', '-a', '--format', 'json']);
|
|
148
148
|
|
|
149
149
|
check.stdout.on('data', (data) => {
|
|
150
|
+
// var tmp = data.toString();
|
|
151
|
+
// var tmpJson = JSON.parse(tmp);
|
|
152
|
+
// console.log(tmpJson);
|
|
153
|
+
|
|
150
154
|
const q = 'map(select(.Name == "directus")) | .[0] | {Name: .Name, Service: .Service, State: .State}';
|
|
151
155
|
jq.run(q, data.toString(), { input: 'string' })
|
|
152
156
|
.then((data) => {
|