Skip to content

Commit

Permalink
Use Traefik to allow HTTPS by proxying requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Dec 6, 2023
1 parent 5291a2f commit 4624692
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
2 changes: 1 addition & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ drupal:
tags: "~@blackbox&&~@wip"
extensions:
Drupal\MinkExtension:
base_url: http://drupal
base_url: http://proxy
files_path: /var/www/html/fixtures/files
Drupal\DrupalExtension:
api_driver: "drupal"
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"require-dev": {
"composer/installers": "^2",
"drupal/coder": "^8.3",
"drupal/core": "^9.4 || ^10.0",
"drupal/core-composer-scaffold": "^9.4 || ^10.0",
"drush/drush": "^11.0",
"drupal/core": "^10",
"drupal/core-composer-scaffold": "^10",
"drush/drush": "^12.4",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpspec/phpspec": "^4.0 || ^6.0 || ^7.0"
},
Expand Down
46 changes: 36 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,58 @@ services:
PHP_IDE_CONFIG: "serverName=drupalextension"
volumes:
- ./:/var/www/html
labels:
- "traefik.enable=false"
depends_on:
- proxy

proxy:
image: traefik:v2.10
command:
- "--api.insecure=true"
- "--providers.docker"
- "--entrypoints.http-80.address=:80"
- "--entrypoints.http-443.address=:443"
ports:
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.enable=false"

drupal:
image: wodby/nginx:1.16-5.11.3
image: wodby/nginx
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/drupal
NGINX_VHOST_PRESET: drupal9
NGINX_VHOST_PRESET: drupal10
volumes:
- ./:/var/www/html
ports:
- "8080:80"
labels:
- "traefik.http.routers.drupal.rule=Host(`proxy`)"
- "traefik.http.routers.drupal.entrypoints=http-80"
- "traefik.http.routers.drupal-secure.rule=Host(`proxy`)"
- "traefik.http.routers.drupal-secure.tls=true"
- "traefik.http.routers.drupal-secure.entrypoints=http-443"

blackbox:
image: wodby/nginx:1.16-5.11.3
image: wodby/nginx
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_SERVER_ROOT: /var/www/html/fixtures/blackbox
NGINX_VHOST_PRESET: html
volumes:
- ./:/var/www/html
ports:
- "8081:80"
labels:
- "traefik.enable=false"

db:
image: wodby/mariadb:10.3-3.8.4
Expand All @@ -56,6 +81,8 @@ services:
MYSQL_DATABASE: drupal
MYSQL_USER: drupal
MYSQL_PASSWORD: drupal
labels:
- "traefik.enable=false"

node:
image: node:latest
Expand All @@ -67,6 +94,5 @@ services:
volumes:
- ./:/home/node/app
command: "sleep infinity"

volumes:
codebase:
labels:
- "traefik.enable=false"

0 comments on commit 4624692

Please sign in to comment.