No words necessary!
No words necessary!
I have been doing my Drupal development in a virtual machine using Virtualbox for some time. When I was working at the office this is just fine, apart from the fact that it is somewhat slow: I start the VM, wait for it to finish, then make an SSHFS connection to the VM, start PhpStorm, and wait again for PhpStorm to stop indexing (which is REALLY slow).
Now that I’m working from home I faced a problem. I can only connect to the git repositories at work using a VPN connection, but when I start the VPN connection I cannot connect to my VM anymore. This makes pushing and pulling to/from the git repositories cumbersome.
In comes Docker4Drupal. It took some figuring out, especially getting multiple projects to work next to one another, but I got it working.
Docker4Drupal is a Docker-based Drupal stack: a set of docker images optimized for Drupal. You can choose Nginx or Apache, Mariadb or Postgres, Drupal 7 or 8, PHP 7.2, 7.3 or 7.4. There is a plethora of other tools you can choose from, like Redis, Varnish or Memcached for caching, Solr, Elasticsearch and Kibana for search, and a lot more.
I’ll start with basic installation and will get to a more sophisticated setup in a later post. I found this very instructive video: https://www.youtube.com/watch?v=aYb8C18HjmY, I’ll describe it below.
You start with using composer:
composer create-project drupal-composer/drupal-project:8.x-dev project_name --no-interaction (this creates a project in the folder
clone drupal-project — and runs
composer install; make sure to rename the project name)
Then you get the Docker4Drupal stuff:
git clone https://github.com/wodby/docker4drupal.git docker_drupal_server
Because you don’t need the git repository stuff:
rm -rf docker_drupal_server/.git
And remove the docker-compose override:
Then copy the Docker4Drupal stuff in the project folder:
cp -R docker_drupal_server/ project_name
Now comes the configuration. Open the
.env file and make the necessary changes, starting with the project name and URL.
You can make choises about the versions for all the components in the other tags.
Once you have completed the configuration, you can start your container:
docker-compose up -d
Now you go to http://drupal.docker.localhost:8000 (change URL to the one used in
.env) and start your Drupal installation.
Since all the folders are on my local machine, I don’t need the VM anymore and I can connect to my git repositories at work while using the VPN connection.
I’ll get to a more specific setup with more than one project in a later post. Also, because I’m using a Mac, I need to use something called docker-sync. This needs some special attention too.
The Corona crisis is well on its way. It’s Whit Monday, June 1, 2020. I’ve been working from home since March 13.
To be quite honest, I don’t mind working at home, I’ve been making quite some progress on several projects. For me it’s a lot easier to concentrate on my work than at my regular workplace. There is a lot less interrupting going on, although I do need to make sure I don’t try to follow the chat window where my colleagues are chatting about stuff I’m not involved with.
The first week or so I found myself exhausted in the evening. Now I guess I have found my way. I do need to schedule my projects, really from hour to hour, just to make sure I’m not over-concentrating or lose myself in the project (you know, just do this last thing before moving on!).
I have no idea when this is going to end, but my guess is it will take some more weeks or even months. The new normal is going to be strange. Are we going to go back to our jobs as we used to do? Is that something we would want? I wouldn’t mind working from home for 3 or maybe even 4 days a week and just have 1 or 2 days at the office, to quickly catch up with people, and chat about other things than just work. Although I am an introvert, just talking to people (face to face) would be nice.
We’ll see how this pans out.
Via Nicholas Bate.
I’m going too Mars again!
I’ve been doing a lot of Drupal work lately. For the last couple of days I’ve been struggling with the deployment of a website I’m working on. For some reason one of the standard Drupal tables in the Postgresql database ended up being owned by another Postgresql role. This resulted in an error in the deployment. I have literally been staring at the error for two days, I could not figure out where it went wrong. After a lot of searching on the internet I finally found out what the problem was!
Postgresql uses a database called
template1 when a new database is created as a template. For some reason there was a relation defined in
template1 for the table that caused the error in the deployment. The relation defined the table to be owned by another Postgresql role. The problem I had could be solved by removing the
template1 database, but this is only possible when you tell Postgresql the template is not a template anymore (because template databases cannot be dropped). So I had to issue the following command:
update pg_database set datistemplate = false where datname = 'template1';
Now you can
drop database template1;
after which you can recreate it using
create database template1 template template0;
Now I was finally able to deploy the website. Well, until another problem raised it’s ugly head. But that is a problem for tomorrow.
I was catching up on some blog posts by Derek when I read this here. So true.
This shows that Mercedes is totally lost when things don’t go their way!
Mercedes messy pit-stop sounds much better with Benny Hill pic.twitter.com/vxO1pzX0Cp— Tancredi Palmeri (@tancredipalmeri) July 29, 2019
Definitely the best move of the weekend! F1 needs to get its act together.