Docker setup environment for Magento.
-
Download you project files into - www/
-
Set you mounted services - docker-compose.yml
-
Set virtual hosts for container - config/vhost
-
Set credentials for remote repositories - config/auth.json
-
ONLY Magento 2.x. Set sync folder path - docker-sync.yml
- Create project environment image (tag name same as in docker-compose.yml).
docker image build -t you_group/project_name:latest path_to_docker_file
- ONLY Magento 2.x. Create & launch sync image.
docker-sync start
- Launch project containers via docker-compose.
docker-compose up -d
- Add project host name to local hosts on your laptop sudo vi /etc/hosts
-
docker ps - show all launched services/containers
-
docker-compose start/stop/restart/pause/unpause
-
docker-sync start/stop/sync
-
docker exec -it you_service/container_name bash - execute launched service/container by name
-
docker inspect you_service/container_name - get launched service/container full info