Skip to content

Commit

Permalink
2.0.1: enable traefik by default
Browse files Browse the repository at this point in the history
  • Loading branch information
csandanov committed Mar 13, 2017
1 parent ca87761 commit 8ee4eb5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Docker4Drupal Changelog

## 2.0.1

* Traefik with domains is now enabled by default
* Updates in documentation
* Updated redis image

## 2.0.0

* 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)
Expand Down
35 changes: 12 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ services:
- 'traefik.backend=nginx'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:drupal.docker.localhost'
ports:
- "8000:80"

# varnish:
# image: wodby/drupal-varnish:4.1-2.0.0
Expand All @@ -56,9 +54,6 @@ services:
# - 'traefik.backend=varnish'
# - 'traefik.port=6081'
# - 'traefik.frontend.rule=Host:varnish.drupal.docker.localhost'
# ports:
# - "8004:6081" # HTTP Proxy
# - "8005:6082" # Control terminal

redis:
image: wodby/redis:3.2-2.0.1
Expand All @@ -75,8 +70,6 @@ services:
- 'traefik.backend=pma'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:pma.drupal.docker.localhost'
ports:
- "8001:80"

solr:
image: wodby/drupal-solr:8-6.4-2.0.0
Expand All @@ -88,43 +81,39 @@ services:
- 'traefik.backend=solr'
- 'traefik.port=8983'
- 'traefik.frontend.rule=Host:solr.drupal.docker.localhost'
ports:
- "8003:8983"

mailhog:
image: mailhog/mailhog
labels:
- 'traefik.backend=mailhog'
- 'traefik.port=8025'
- 'traefik.frontend.rule=Host:mailhog.drupal.docker.localhost'
ports:
- "8002:8025"

# node:
# image: node:7-alpine
# working_dir: /app
# labels:
# - 'traefik.backend=node'
# - 'traefik.port=80'
# - 'traefik.port=3000'
# - 'traefik.frontend.rule=Host:front.drupal.docker.localhost'
# ports:
# - "3000:3000"
# expose:
# - "3000"
# volumes:
# - ./path/to/your/single-page-app:/app
# command: sh -c 'npm install && npm run start'

# memcached:
# image: memcached:1.4-alpine

# traefik:
# image: traefik
# restart: unless-stopped
# command: -c /dev/null --web --docker --logLevel=INFO
# ports:
# - '80:80'
# - '8080:8080'
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
traefik:
image: traefik
restart: unless-stopped
command: -c /dev/null --web --docker --logLevel=INFO
ports:
- '8000:80'
- '8080:8080'
volumes:
- /var/run/docker.sock:/var/run/docker.sock

# Docker-sync for macOS users
#volumes:
Expand Down
20 changes: 13 additions & 7 deletions docs/domains.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Domains configuration

To use custom domain for your project follow these steps:
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.

1. Uncomment definition of traefik service in the compose file
2. Make sure port 80 is free on your host machine
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
4. Remove public ports definition from all services except traefik, you don't need them now
5. That's it! Run the compose file and check that domains work fine (default `http://drupal.docker.localhost/`)
6. Also you can visit traefik dashboard on `localhost:8080`
Default domains:

| Service | Domain |
| ------- | ------ |
| nginx | http://drupal.docker.localhost:8080 |
| pma | http://pma.drupal.docker.localhost:8080 |
| mailhog | http://mailhog.drupal.docker.localhost:8080 |
| solr | http://solr.docker.localhost:8080 |
| node | http://front.drupal.docker.localhost:8080 |
| varnish | http://varnish.drupal.docker.localhost:8080 |

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
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The Drupal bundle consist of the following containers:
| [Mailhog](containers/mailhog.md) | mailhog | [mailhog/mailhog](https://hub.docker.com/r/mailhog/mailhog) | 8002 ||
| [Node.js 7](containers/node.md) | node | [_/node](https://hub.docker.com/_/node) | 3000 | |
| [Memcached](containers/memcached.md) | memcached | [_/memcached](https://hub.docker.com/_/memcached/) | | |
| Traefik | traefik | [_/traefik](https://hub.docker.com/_/traefik/) | | |

Supported Drupal versions: 6/7/8.

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

You can stop containers by executing:
```bash
Expand Down

0 comments on commit 8ee4eb5

Please sign in to comment.