- OS: Linux / MacOS / Windows 10 Pro (with HyperV)
- Docker
- Create a new directory for your local server (MY_APP is used as a placeholder)
- Add
docker-compose.yml
,Dockerfile
andnginx.conf
files to the root of your server directory. - With your favorite terminal application:
cd /path/to/MY_APP
(replace/path/to/MY_APP
with the path to your local server directory created above.docker-compose up -d
- Open http://localhost:8000 with your favorite browser and start developing.
-
(Optional) In the
nginx.conf
file, replacemy-app.local
with the desired virtual hostname.If you choose to use a different hostname, then replace all mentions of
my-app.local
with your choosen hostname. -
Add
127.0.0.1 my-app.local
to your hosts filehosts
file (how to modify your hosts file - guide) -
Start the container
docker-compose up -d
. -
Open http://my-app.local
Adminer is tool for accessing and managing your mysql database. Access it via http://localhost:8080
I've tested it and its doesn't work without volumes declaration :
ERROR: Named volume "db-data:/var/lib/mysql:rw" is used in service "db" but no declaration was found in the volumes section.
We should add volumes as you mentioned and thanks.