Skip to content

Commit 8ee4eb5

Browse files
committed
2.0.1: enable traefik by default
1 parent ca87761 commit 8ee4eb5

File tree

4 files changed

+34
-32
lines changed

4 files changed

+34
-32
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Docker4Drupal Changelog
22

3+
## 2.0.1
4+
5+
* Traefik with domains is now enabled by default
6+
* Updates in documentation
7+
* Updated redis image
8+
39
## 2.0.0
410

511
* All-new 2.0.0 docker images: [drupal-nginx](https://github.com/wodby/drupal-nginx/), [drupal-php](https://github.com/wodby/drupal-php/), [mariadb](https://github.com/wodby/mariadb/), [redis](https://github.com/wodby/redis/), [drupal-varnish](https://github.com/wodby/drupal-varnish/). You can now customize images with environment variable and override entire configs by using .tpl template (based on confd). Some images come with actions you can execute (e.g. create Solr core with Search API configs)

docker-compose.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ services:
4141
- 'traefik.backend=nginx'
4242
- 'traefik.port=80'
4343
- 'traefik.frontend.rule=Host:drupal.docker.localhost'
44-
ports:
45-
- "8000:80"
4644

4745
# varnish:
4846
# image: wodby/drupal-varnish:4.1-2.0.0
@@ -56,9 +54,6 @@ services:
5654
# - 'traefik.backend=varnish'
5755
# - 'traefik.port=6081'
5856
# - 'traefik.frontend.rule=Host:varnish.drupal.docker.localhost'
59-
# ports:
60-
# - "8004:6081" # HTTP Proxy
61-
# - "8005:6082" # Control terminal
6257

6358
redis:
6459
image: wodby/redis:3.2-2.0.1
@@ -75,8 +70,6 @@ services:
7570
- 'traefik.backend=pma'
7671
- 'traefik.port=80'
7772
- 'traefik.frontend.rule=Host:pma.drupal.docker.localhost'
78-
ports:
79-
- "8001:80"
8073

8174
solr:
8275
image: wodby/drupal-solr:8-6.4-2.0.0
@@ -88,43 +81,39 @@ services:
8881
- 'traefik.backend=solr'
8982
- 'traefik.port=8983'
9083
- 'traefik.frontend.rule=Host:solr.drupal.docker.localhost'
91-
ports:
92-
- "8003:8983"
9384

9485
mailhog:
9586
image: mailhog/mailhog
9687
labels:
9788
- 'traefik.backend=mailhog'
9889
- 'traefik.port=8025'
9990
- 'traefik.frontend.rule=Host:mailhog.drupal.docker.localhost'
100-
ports:
101-
- "8002:8025"
10291

10392
# node:
10493
# image: node:7-alpine
10594
# working_dir: /app
10695
# labels:
10796
# - 'traefik.backend=node'
108-
# - 'traefik.port=80'
97+
# - 'traefik.port=3000'
10998
# - 'traefik.frontend.rule=Host:front.drupal.docker.localhost'
110-
# ports:
111-
# - "3000:3000"
99+
# expose:
100+
# - "3000"
112101
# volumes:
113102
# - ./path/to/your/single-page-app:/app
114103
# command: sh -c 'npm install && npm run start'
115104

116105
# memcached:
117106
# image: memcached:1.4-alpine
118107

119-
# traefik:
120-
# image: traefik
121-
# restart: unless-stopped
122-
# command: -c /dev/null --web --docker --logLevel=INFO
123-
# ports:
124-
# - '80:80'
125-
# - '8080:8080'
126-
# volumes:
127-
# - /var/run/docker.sock:/var/run/docker.sock
108+
traefik:
109+
image: traefik
110+
restart: unless-stopped
111+
command: -c /dev/null --web --docker --logLevel=INFO
112+
ports:
113+
- '8000:80'
114+
- '8080:8080'
115+
volumes:
116+
- /var/run/docker.sock:/var/run/docker.sock
128117

129118
# Docker-sync for macOS users
130119
#volumes:

docs/domains.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Domains configuration
22

3-
To use custom domain for your project follow these steps:
3+
Docker4Drupal uses [traefik](https://hub.docker.com/_/traefik/) container for routing. By default, we use port 8080 to avoid potential conflicts but if port 80 is free on your host machine just replace traefik's ports definition in the compose file.
44

5-
1. Uncomment definition of traefik service in the compose file
6-
2. Make sure port 80 is free on your host machine
7-
3. Customize your base domain under services labels. The default base domain is `drupal.docker.localhost` in `traefik.frontend.rule=Host:mailhog.drupal.docker.localhost`. If domains end with `docker.localhost` you don't need to add records to /etc/hosts file
8-
4. Remove public ports definition from all services except traefik, you don't need them now
9-
5. That's it! Run the compose file and check that domains work fine (default `http://drupal.docker.localhost/`)
10-
6. Also you can visit traefik dashboard on `localhost:8080`
5+
Default domains:
6+
7+
| Service | Domain |
8+
| ------- | ------ |
9+
| nginx | http://drupal.docker.localhost:8080 |
10+
| pma | http://pma.drupal.docker.localhost:8080 |
11+
| mailhog | http://mailhog.drupal.docker.localhost:8080 |
12+
| solr | http://solr.docker.localhost:8080 |
13+
| node | http://front.drupal.docker.localhost:8080 |
14+
| varnish | http://varnish.drupal.docker.localhost:8080 |
15+
16+
You can customize domains under labels definition, e.g. `traefik.frontend.rule=Host:mailhog.drupal.docker.localhost`. Note: if domains end with `docker.localhost` you don't need to add records to /etc/hosts file

docs/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The Drupal bundle consist of the following containers:
2020
| [Mailhog](containers/mailhog.md) | mailhog | [mailhog/mailhog](https://hub.docker.com/r/mailhog/mailhog) | 8002 ||
2121
| [Node.js 7](containers/node.md) | node | [_/node](https://hub.docker.com/_/node) | 3000 | |
2222
| [Memcached](containers/memcached.md) | memcached | [_/memcached](https://hub.docker.com/_/memcached/) | | |
23+
| Traefik | traefik | [_/traefik](https://hub.docker.com/_/traefik/) | | |
2324

2425
Supported Drupal versions: 6/7/8.
2526

@@ -43,9 +44,9 @@ Feel free to adjust volumes and ports in the compose file for your convenience.
4344
3. Make sure you have the same database credentials in your settings.php file and MariaDB service definition in the compose file
4445
4. Optional: [import existing database](containers/mariadb.md#import-existing-database)
4546
6. Optional: add additional services (Varnish, Apache Solr, Memcached, Node.js) by uncommenting the corresponding lines in the compose file
46-
7. Optional: [attach domains](domains.md)
47+
7. Optional: [configure domains](domains.md)
4748
8. Run containers: `docker-compose up -d`
48-
9. That's it! You drupal website should be up and running at http://localhost:8000 (or http://drupal.docker.localhost if you use domains)
49+
9. That's it! You drupal website should be up and running at http://drupal.docker.localhost:8080
4950

5051
You can stop containers by executing:
5152
```bash

0 commit comments

Comments
 (0)