I have a docker- compose file for my local development. At this moment it works fine. the only thing is I find it annoying to manually change the ip corresponding to my local app hostname in my machine hosts file (/etc/hosts in ubuntu). I need to access the application with a hostname because the application has subdomains (so http://localhost is definitely not enough). Is there a solution for this? Here is mo docker-compose file:
version: '2'
services:
app:
build:
context: .
dockerfile: Dockerfile
image: myexampleapp
ports:
- 8080:80
tty: true
volumes:
- .:/var/www/example
links:
- mysql
mysql:
image: mysql:5.7.22
ports:
- 33060:3306
environment:
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: dev
volumes:
- ./data:/var/lib/mysql
Thanks