Issue
I have the basic docker-compose.yml
shown below for an apache server. And I was wondering if there was a way to configure this apache server, which is currently accessible using 0.0.0.0:8889 OR localhost:8889, so is it accessible using a custom host name, such as: local.foobar.dev
for example?
version: '3'
services:
snappyweb:
image: php:7.0-apache
ports:
- "8889:80"
volumes:
- ./:/var/www/html
Solution
I assume you want this to only work for your local dev environment.
The easiest and safest way is to use an application that will essentially trick your local browser into thinking a URL of choice is a certain IP address. That IP could be a locahost:8000
.
For this I use GasMask (osX) or your can use Host File Manager (Windows).
Answered By - Andrew Graham-Yooll Answer Checked By - Pedro (WPSolving Volunteer)