User Tools

Site Tools


guifi.net:entorno_desarrollo

This is an old revision of the document!


Entorno de desarrollo para la web de Guifi

Repositori: https://gitlab.guifi.net/ramon.roca/drupal9-guifi-networks

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
chmod 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/*
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
guifi.net/entorno_desarrollo.1667820969.txt.gz · Last modified: 2022/11/07 11:36 by jose