Skip to content

Commit 81ee115

Browse files
committedOct 4, 2018
update project structure
1 parent f383d14 commit 81ee115

File tree

8 files changed

+43
-64
lines changed

8 files changed

+43
-64
lines changed
 

‎.gitignore

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
.idea/
22

33
# mysql data
4-
data/mysql
5-
!data/mysql/.gitkeep
4+
var/mysql
5+
!var/mysql/.gitkeep
66

77
# redis data
8-
data/redis
9-
!data/redis/.gitkeep
8+
var/redis
9+
!var/redis/.gitkeep
1010

1111
# projects
12-
/projects
13-
!/projects/default/public/index.php
12+
/home
13+
!/home/default/public/index.php

‎README.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -181,22 +181,20 @@ Name Command State Ports
181181

182182

183183
## Denwer 5 structure
184-
- `./build`
185-
Here are the Dockerfiles of custom containers.
186184

187-
- `./config`
185+
- `./etc`
188186
Here are the configs of components that are forwarded to the inside of the container (for example, nginx.conf, php.ini).
189187
After configs change you need to restart Denwer!
190188

191-
- `./data`
189+
- `./var`
192190
Permanent storage for stateful containers (DB).
193191
You can safely delete all files (except the .gitkeep file) inside the `mysql` or` redis` folders, it will reset the database and force
194192
Denwer initialize it empty again (first stop Denwer, then delete files, then start Denwer).
195193

196194
- `./env`
197195
Environment files that are bound in containers.
198196

199-
- `./projects`
197+
- `./home`
200198
Here are your PHP projects.
201199
(see. [How to place and run php code](#how-to-place-and-run-php-code))
202200

@@ -212,14 +210,14 @@ Denwer offers two approaches for placing PHP code inside:
212210
- Single-project with IP access
213211

214212
### One project, access via IP
215-
- Put all your files in `./projects/default`
213+
- Put all your files in `./home/default`
216214
- Your site will be accessible by IP `http://192.168.99.100` (if not working - Denwer got another IP,
217215
see [how to find the Denwer's external IP](#how-to-find-denwer-external-ip) )
218-
- Note that `index.php` should be located in the `public` subfolder, not at the root! (good: `./projects/default/public/index.php`)
216+
- Note that `index.php` should be located in the `public` subfolder, not at the root! (good: `./home/default/public/index.php`)
219217

220218
### Multiple-projects with domain support for each project
221-
- Each folder inside `./Projects` is a project and is available by the name of the form `*.denwer`
222-
(for example, the default project `default`, which is located in `./project/default` is available at `http://default.denwer/`)
219+
- Each folder inside `./home` is a project and is available by the name of the form `*.denwer`
220+
(for example, the default project `default`, which is located in `./home/default` is available at `http://default.denwer/`)
223221
- You need to add an entry for the `default.denwer` domain to the file `C:\Windows\System32\drivers\etc\hosts` on your PC
224222
```text
225223
192.168.99.100 default.denwer

‎README_RU.md

+24-14
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Denwer 5 содержит в себе готовые для работы ком
3232
- [Остановка Denwer](#6-Остановка-denwer)
3333
- [Описание внутренней структуры](#Описание-внутренней-структуры-denwer-5)
3434
- [Куда положить PHP код?](#Куда-положить-php-код)
35-
- [Один проект, доступ по IP]()
36-
- [Мультипроектность, доступ по домену]()
35+
- [Один проект, доступ по IP](#Один-проект-доступ-по-ip)
36+
- [Мультипроектность, доступ по домену](#Мультипроектность-с-поддержкой-доменов-для-каждого-проекта)
3737
- [Перенос Denwer на диск D](#Перенос-denwer-на-диск-d)
3838
- [F.A.Q](#faq)
3939
- [Как узнать какой IP у Denwer?](#Как-узнать-какой-ip-у-denwer)
@@ -181,22 +181,20 @@ Name Command State Ports
181181

182182

183183
## Описание внутренней структуры Denwer 5
184-
- `./build`
185-
Здесь находятся Dockerfile кастомных контейнеров, которые собираются "под себя".
186184

187-
- `./config`
185+
- `./etc`
188186
Здесь лежат конфиги компонентов, которые пробрасываются внутрь контейнера (например nginx.conf, php.ini).
189187
После изменений в конфигах нужно перезапустить Denwer и он подтянет все изменения!
190188

191-
- `./data`
189+
- `./var`
192190
Постоянное хранилище для stateful-контейнеров (БД).
193191
Можно смело удалять все файлы (кроме файла .gitkeep) внутри папок `mysql` или `redis`, это обнулит БД и заставит
194192
Denwer инициализировать ее пустой заново (сначала выключаем Denwer, потом чистим, потом включаем).
195193

196194
- `./env`
197195
Файлы окружения, которые пробрасываются внутрь контейнеров.
198196

199-
- `./projects`
197+
- `./home`
200198
Здесь лежат ваши проекты на PHP.
201199
(см. [где положить PHP код](#Куда-положить-php-код))
202200

@@ -212,14 +210,14 @@ Denwer предлагает два подхода по размещению ко
212210
- Однопроектность по IP
213211

214212
### Один проект, доступ по IP
215-
- Положите все ваши файлы в `./projects/default`
213+
- Положите все ваши файлы в `./home/default`
216214
- Ваш сайт будет доступен по IP `http://192.168.99.100` (если не работает - Denwer получил другой IP,
217215
см. [какой IP получил Denwer](#Как-узнать-какой-ip-у-denwer) )
218-
- Обратите внимание, `index.php` должен находится в подпапке `public`, а не в корне проекта! (`./projects/default/public/index.php`)
216+
- Обратите внимание, `index.php` должен находится в подпапке `public`, а не в корне проекта! (`./home/default/public/index.php`)
219217

220218
### Мультипроектность с поддержкой доменов для каждого проекта
221-
- Каждая папка внутри `./projects` является самостоятельным проектом и доступна по имени вида `*.denwer`
222-
(например, проект по умолчанию `default`, который распологается в `./project/default` доступен по адресу `http://default.denwer/`)
219+
- Каждая папка внутри `./home` является самостоятельным проектом и доступна по имени вида `*.denwer`
220+
(например, проект по умолчанию `default`, который распологается в `./home/default` доступен по адресу `http://default.denwer/`)
223221
- Необходимо добавить запись о домене `default.denwer` в файл `C:\Windows\System32\drivers\etc\hosts` на вашем ПК:
224222
```text
225223
192.168.99.100 default.denwer
@@ -324,7 +322,7 @@ cd /var/www/projects/default
324322

325323

326324
### Как с PHP подключиться к MySQL, Redis, Memcache?
327-
- Смотрите файл `./projects/default/index.php`, там есть примеры подключения ко всем БД.
325+
- Смотрите файл `./home/default/index.php`, там есть примеры подключения ко всем БД.
328326
- Если файл потерялся, то вот креды:
329327
```text
330328
Mysql:
@@ -359,10 +357,22 @@ ports:
359357
360358
361359
### Как мне включить расширение PHP (любое)?
362-
todo
360+
- mkdir ./build/
361+
- Clone repository `https://github.com/Shcneider/denwer5-php7.2-docker-image`
362+
- Add custom extensions in `Dockerfile`
363+
- Edit docker-compose.yml: comment `image` section of service `php`, uncomment `build` of service `php`
364+
- Run `docker-compose build`
365+
- Run Denwer
366+
- Your custom php image is ready and work!
363367

364368
### Как поменять версию PHP на 7.1, 7.0, 5.6?
365-
todo
369+
- mkdir ./build/
370+
- Clone repository `https://github.com/Shcneider/denwer5-php7.2-docker-image`
371+
- Change PHP version in `Dockerfile` (first line)
372+
- Edit docker-compose.yml: comment `image` section of service `php`, uncomment `build` of service `php`
373+
- Run `docker-compose build`
374+
- Run Denwer
375+
- Your custom php image is ready and work!
366376

367377

368378

‎build/php/readme.md

-7
This file was deleted.

‎docker-compose.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ services:
1717
networks:
1818
- denwer
1919
volumes:
20-
- ./projects/:/var/www/projects/
21-
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
20+
- ./home/:/var/www/projects/
21+
- ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf
2222

2323
php:
2424
image: shcneider/php7.2-fpm-stretch-composer-extensions:latest
@@ -28,8 +28,8 @@ services:
2828
networks:
2929
- denwer
3030
volumes:
31-
- ./projects/:/var/www/projects/
32-
- ./config/php72/php.ini:/usr/local/etc/php/php.ini
31+
- ./home/:/var/www/projects/
32+
- ./etc/php72/php.ini:/usr/local/etc/php/php.ini
3333
env_file: env/php.env
3434

3535
mysql:
@@ -44,7 +44,7 @@ services:
4444
networks:
4545
- denwer
4646
volumes:
47-
- ./data/mysql:/var/lib/mysql/
47+
- ./var/mysql:/var/lib/mysql/
4848
env_file: env/mysql.env
4949

5050
redis:
@@ -58,8 +58,7 @@ services:
5858
networks:
5959
- denwer
6060
volumes:
61-
- ./data/redis:/data
62-
#- ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf
61+
- ./var/redis:/data
6362

6463
memcached:
6564
image: memcached:latest
File renamed without changes.
File renamed without changes.

‎projects/default/public/index.php

-21
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.