By devaper on
(I posted a version of this earlier but it keeps getting flagged as spam.)
Someone assisted me in installing Drupal with Docker on my Mac. (I am new to Drupal and it has been years since I last coded.) The site works fine. I would like to set up a custom theme, but when I open VS Code in the installation directory, there are only the following files: .env, .gitignore, docker-compose.yaml. I don't see a theme directory or anything that I expected. The docker-compose.yaml file has this in it:
volumes:
- drupal-data: /var/www/html
So it looks like all the files should be in /var/www/html. The problem is that this directory doesn't exist on my machine. Can someone point me to where the files should be?
Comments
I'm not familiar with how
I'm not familiar with how that's set up but if you search for the
core.services.ymlfile the sites directory should be a level or two above.Available for paid support, module development, migrations, consulting...
I figured it out and am
I figured it out and am adding this note to hopefully help other users. The code resides in the Docker container and you can it by doing the following:
(A) From the command line run this command:
% docker exec -it drupal bash
Where "drupal" is replaced with the name of your container. You may have to use "/bin/bash" instead of "bash". You will then be able to see the files, open them with nano or vi, etc.
(B) Use the Docker extension in VS Code:
Install the docker extension in VS Code (https://code.visualstudio.com/docs/editor/extension-marketplace). If docker is running it will automatically pick up the containers and allow you to navigate in the folder structure, add files, etc.
HTH.
DDEV
Great that you found a solution!
In case you want to use a tool with more users and support, the officially recommended development environment for Drupal is DDEV: https://ddev.com/
Thanks. In the end my
Thanks. In the end my solution didn't work that well and I had to reinstall Drupal using the Drupal.org instructions, including using DDEV.