Here is my setup:
I have a Ubuntu 20.04.2 LTS machine running in VMware (vSphere client).
On this machine, I have a local Drupal website running in Docker using Wodby Docker4Drupal https://github.com/wodby/docker4drupal
The website can be accessed on the Ubuntu machine on http://drupal.localhost:8000.
The Ubuntu machine has an IP of 192.168.10.100 which I can ping from my local Windows machine which is on the same LAN (Windows computer IP address is 192.168.10.97).
Is there any way that I could access the Drupal website directly from the browser on a computer that is on the same LAN (ie. my Windows machine)?
I have tried to access http://192.168.10.100:8000 but I get a 404 page not found
message. On port 80
I get ERR_CONNECTION_REFUSED
. Any idea?
I shall also mention that on the Ubuntu VM, I also get the same 404 page not found
if I try to reach http://0.0.0.0:8000 or http://127.0.0.1:8000 or http://localhost:8000. Only the hostname configured within the project resolves to the Drupal website (http://drupal.localhost:8000).
Here is the docker-compose.yml
I am using.
version: "3.7"
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
volumes:
- d4d-db-data:/var/lib/mysql # Use bind mount
php:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
volumes:
- ./web:/var/www/html:cached
crond:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_crond"
environment:
CRONTAB: "0 * * * * drush -r /var/www/html/web cron"
command: sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so crond -f -d 0
volumes:
- ./web:/var/www/html:cached
nginx:
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_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/web
NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
# NGINX_DRUPAL_FILE_PROXY_URL: http://example.com
volumes:
- ./web:/var/www/html:cached
labels:
- "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"
mailhog:
image: mailhog/mailhog
container_name: "${PROJECT_NAME}_mailhog"
labels:
- "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
- "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(`mailhog.${PROJECT_BASE_URL}`)"
traefik:
image: traefik:v2.0
container_name: "${PROJECT_NAME}_traefik"
command: --api.insecure=true --providers.docker
ports:
- '8000:80'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
volumes:
d4d-db-data: