My first day with Docker!
This is my first blog post in english and its possibility that I have a lot of grammatical errors.
The Compose file is a YAML file defining services, networks and volumes. Our proyect have four services (web, mysql, selenium, sparql )
Services/Containers The id of de containers can change but its alias never change. Inside /lib is the works custom.
Services
- Web: this container organize service apache, Its directories and configurations.
- MySQL: this container ornagaze service mysql, its directories and configurations.
- Sparql: this container have a database MySQL that maneges all Drupal’s taxonomies, subthemes, configurations.
Docker utility commands
- sudo chmod 666 /var/run/docker* -> permissions to the docker folder.
- docker-compose stop -> stop docker and its services.
- docker-compose up -d -> start docker and its services.
- docker ps -> it shows the status of all running process along theirs ID’s.
- docker inspect -> return slow-level information on Docker object, we get ip to proyect deploy.
- docker-compose exec web ./vendor/bin/run toolkit:install-clean -> Eject “toolkit:install-clean” in “./vendor/bin/”, this command installs our Drupal.
- docker-compose exec web composer install -> whithin the “Web” services we ejecute this command “composer install”.
- docker-compose exec web ./vendor/bin/drush sql-drop –yes -> Drop proyect database.
- docker-compose exec web ./vendor/bin/drush sql-create –yes -> Create proyect database.
- docker-compose exec -T web ./vendor/bin/drush sqlc < ./db/europass_dump.sql -> Load proyect database.
- docker-compose exec mysql /bin/bash -> open prompt mysql.
- docker cp ./europass_dump.sql $IDCONTAINER:/tmp/ -> cp dump to Mysql services.
- docker-compose exec mysql mysql -u root -p -> open Mysql
- docker system prune -f -> reset docker after “docker-compose stop”
- docker-compose exec web ./vendor/bin/drush cex -> drush config-export
- docker exec 2124abc05c6f /usr/bin/mysqldump -u root -p openeuropa_site > europass_dump1.sql -> export db
Files of interest
- .env -> Enviroment variables, it values are availables to containers.
- ./docker-compose.yml. -> This is default path for a Compose file
Written on July 17, 2019