Repositori: https://gitlab.guifi.net/ramon.roca/drupal9-guifi-networks
https://gitlab.guifi.net/jose.legido/docker-drupal9
Drupal 9
docker-compose.yml
version: '3.1' services: drupal: image: drupal:9-apache ports: - 8096:80 volumes: - '${PWD}/html/modules:/var/www/html/modules' - '${PWD}/html/profiles:/var/www/html/profiles' - '${PWD}/html/themes:/var/www/html/themes' # this takes advantage of the feature in Docker that a new anonymous # volume (which is what we're creating here) will be initialized with the # existing content of the image at the same location - /var/www/html/sites restart: always db: image: mysql:5.7 volumes: - '${PWD}/db_data:/var/lib/mysql' environment: MYSQL_ROOT_PASSWORD: guifi MYSQL_DATABASE: net9 MYSQL_USER: net9 MYSQL_PASSWORD: development ports: - "3306:3306" restart: always
Configuramos docker-dupal:
docker exec -ti docker-drupal_drupal_1 bash
Instalar composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');" mv composer.phar /usr/local/bin/composer
Instalar DRUSH
composer require drush/drush
Preparar entorno:
cd /var/www/html sudo mkdir net9ldev chown www-data:www-data net9ldev composer create-project drupal/recommended-project:^9 net9ldev
Install drupal
cd /var/www/html/net9ldev/web/sites/default cp default.settings.php settings.php chmod a+rw settings.php mkdir files chmod a+rw files mkdir files/styles chmod a+rw files/styles
Le damos permisos a todo como www-data (tarda un poquillo):
chown -R www-data:www-data /var/www/html/*
Reiniciar apache
drush si standard --db-url=mysql://net9:development@172.17.0.1:3306/net9 drush site-install standard -y --site-name="Drupal Guifi" --account-name=admin --account-pass=admin --db-url=mysql://net9:development@172.17.0.1/net9 -vvvv
sed -i 's/"stable"/"dev"/g' composer.json drush pm:enable action tracker inline_form_errors layout_builder layout_builder media media_library statistics telephone config_translation content_translation basic_auth jsonapi rest serialization
drush language-add ast drush language-add eu drush language-add ca drush language-add fr drush language-add gl drush language-add de drush language-add el drush language-add it drush language-add pt-pt drush language-add es
composer require drupal/bootstrap5 composer require drupal/admin_toolbar drupal/webform_remote_select drupal/webform_rest drupal/field_group drupal/field_permissions drupal/field_validation drupal/popup_field_group composer require drupal/geocoder:* geocoder-php/nominatim-provider drupal/leaflet drupal/geofield drupal/geofield_map drupal/views_bulk_operations drupal/bulk_update_fields drupal/views_data_export drupal/views_conditional -w composer require drupal/address drupal/tzfield drupal/conditional_fields drupal/calendar composer require drupal/eva drupal/prepopulate drupal/phone_international drupal/taxonomy_manager drupal/auto_entitylabel drupal/inline_entity_form drupal/ief_popup drupal/token drupal/devel composer require drupal/css_editor drupal/date_popup drupal/easy_breadcrumb drupal/eck drupal/external_entities drupal/keycloak drupal/openid_connect drupal/smtp drupal/taxonomy_term_revision drupal/views_dates drupal/views_ef_fieldset drupal/views_summarize drupal/views_timestamp_to_date drupal/view_custom_table drupal/views_autocomplete_filters drupal/views_aggregator drupal/pdf_serialization drupal/entity_extra_field composer require drupal/hacked drupal/coder drupal/security_review
drush theme:enable bootstrap5 drush pm:enable admin_toolbar webform_remote_select webform_rest webform_ui field_group field_permissions field_validation popup_field_group --yes drush pm:enable geocoder leaflet leaflet_markercluster leaflet_views geofield geofield_map views_bulk_operations bulk_update_fields views_data_export views_conditional --yes drush pm:enable address field_layout tzfield geocoder_field geocoder_address geocoder_geofield conditional_fields calendar --yes drush pm:enable eva prepopulate phone_international taxonomy_manager auto_entitylabel inline_entity_form ief_popup token devel --yes drush pm:enable css_editor date_popup easy_breadcrumb eck external_entities keycloak openid_connect smtp taxonomy_term_revision views_dates views_ef_fieldset views_summarize views_timestamp_to_date view_custom_table views_autocomplete_filters views_aggregator pdf_serialization entity_extra_field entity_extra_field_ui --yes drush en hacked coder security_review --yes