Skip to content

Commit 0e26b01

Browse files
Merge pull request #269 from dur41d/master
Added instructions for setting up local dev with ddev
2 parents b8642a4 + 182e4ad commit 0e26b01

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.vuepress/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ module.exports = {
164164
children: [
165165
['/advanced/other-install-methods', 'Other Install Methods'],
166166
['/advanced/source', 'Local Dev Environment'],
167+
['/advanced/ddev', 'Local Dev Environment with DDEV'],
167168
['/advanced/server-setup', 'Server Setup'],
168169
['/advanced/api/configuration', 'API Configuration'],
169170
['/advanced/api/data', 'Direct Data Access']

advanced/ddev.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Setup Development Environment using DDEV
2+
3+
[DDEV](https://ddev.readthedocs.io/en/stable/) allows running the API on your machine using docker which saves you from installing and configuring the dependencies.
4+
5+
## API
6+
7+
* Install DDEV on your machine by following the [installation instructions](https://ddev.readthedocs.io/en/stable/#installation) of your operating system.
8+
* Clone the api repo.
9+
```bash
10+
git clone https://github.com/directus/api.git
11+
OR
12+
git clone [email protected]:directus/api.git
13+
```
14+
* Run ddev config in the API folder and set the `Docroot` to `public` and project type to `php`.
15+
```bash
16+
ddev config
17+
```
18+
19+
* Install composer dependencies.
20+
```bash
21+
ddev exec composer install
22+
```
23+
* Start ddev.
24+
```bash
25+
ddev start
26+
```
27+
* Run the following command in order to get the service and tools details, like `phpmyadmin` and database connection.
28+
```bash
29+
ddev describe
30+
```
31+
32+
33+
## App
34+
35+
* Clone the app repo.
36+
```bash
37+
git clone https://github.com/directus/app.git
38+
OR
39+
git clone [email protected]:directus/app.git
40+
```
41+
* Set the API_URL environment variable to point at the local ddev service URL and start the project.
42+
```bash
43+
set API_URL=http://<ddev-project>.ddev.site/
44+
```
45+
```bash
46+
npm run dev
47+
```
48+
* You'll be prompted to create a new project. Use the following database connection. database=db, port=3306, user=db, password=db.
49+
50+
That's it. You will login to a freshly created Directus project.
51+
52+
**Tip**: ddev allows [PHP Step Debugging](https://ddev.readthedocs.io/en/stable/users/step-debugging/). You can enable it temporarily to avoid performance problems.
53+
54+
```bash
55+
ddev exec enable_xdebug
56+
OR
57+
ddev exec disable_xdebug
58+
```

0 commit comments

Comments
 (0)