Commit fd62e1fa authored by Chris Shantz's avatar Chris Shantz

Merge branch 'wcms-2.x' of https://git.uwaterloo.ca/wcms/wcms-docker into wcms-2.x

parents 509c7e70 7afdcff8
......@@ -42,9 +42,9 @@ To get setup (for both Windows and Mac), follow the instructions [here](https://
On a Windows machine, two changes to their instructions, this is the [link](https://docs.docker.com/install/linux/docker-ce/ubuntu/) to install Docker on Ubuntu and you can install the OCAML 4.07.0 instead of 4.06.0. More information [here](#wsl).
On a Mac you may need to upgrade your copy of XCode if you already have it installed (and remove the old copy) to the latest version, currently 10.2.1.
On a Mac you may need to upgrade your copy of XCode (if you already have it installed) to the latest version, currently 10.2.1. You will need to remove the old version first.
### WSL (for Windows machines)
### WSL (for Windows machines only)
Following the specific instructions for docker-sync on WSL [here](https://docker-sync.readthedocs.io/en/latest/getting-started/installation.html#windows), there is some additional information to help with the setup:
......@@ -82,7 +82,7 @@ The unison and caml parts can be automated a little by simply adding `&& \` to e
To avoid permission errors when launching docker, ensure that the user used when sharing the C: drive with docker also has access to the folder created by the git clone.
### Clone wcms-docker:
### Clone wcms-docker (for all OS'):
You should now be ready to clone the repo:
......@@ -100,15 +100,17 @@ Go into the directory you cloned Docker into:
First we need to build the images, this takes at least 10 minutes or so to build:
```bash
docker-compose build
docker-compose build --no-cache
```
**Note** The first time you run this on a Windows machine, you may be asked to share C: drive and you may need to add a Windows Firewall permission. Click yes/okay for both.
Also **Note** that docker caches images, if you update wcms-docker from Git and there are changes to the Dockerfiles (or anything that gets built by them) for any container you will need to rebuild.
To do this you should use `docker-compose build --no-cache` which builds the image from whatever Dockerfile is referenced in the docker-compose.yml. You will then need to do a `docker-compose up -d` for it to use the new builds.
**Also Note** that docker caches images, if you update wcms-docker from Git and there are changes to the Dockerfiles (or anything that gets built by them) for any container you will need to rebuild.
To do this you should use "docker-compose build --no-cache" which builds the image from whatever Dockerfile is referenced in the docker-compose.yml. You will then need to do a "docker-compose up -d" for it to use the new builds.
On a Windows machine, before you start the containers you will need to start your Ubuntu Shell. Once it's started, and you've logged in you will need to go to the directory you cloned wcms-docker into.
An example might be `cd /mnt/c/Users/<your-username>/docker/wcms-docker` once you are in the folder you need to change one of the docker-sync files to be `docker-sync.yml`:
An example might be "cd /mnt/c/Users/<your-username>/docker/wcms-docker".
For both Windows and Mac's, once you are in the folder you need to change one of the OS specific docker-sync files to be `docker-sync.yml`:
```bash
mv docker-sync_<my OS>.yml docker-sync.yml
......@@ -121,15 +123,15 @@ Then you can run:
```
Which will create the sync folders that are required when you run `docker-compose up -d`
On a Mac, if you get an error `mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h`
It means you need to update your copy of XCode to the latest version (see Install docker-sync above).
**Note** On a Mac, if you get an error `mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h`
It means you need to update your copy of XCode to the latest version (see Install docker-sync above). Once you've updated XCode, continue below.
Once that's done you can create the containers:
```bash
docker-compose up -d
```
If you get an error running docker-compose related to `wincred` go to `~/.docker/config.json` and remove the `"credstore":"wincred"` but leave the curly braces `{}` and save the file.
** Note** on a Windows machine if you get an error running docker-compose related to `wincred` go to `~/.docker/config.json` and remove the `"credstore":"wincred"` but leave the curly braces `{}` and save the file.
To check that all the boxes are running:
......@@ -141,13 +143,13 @@ If all containers say up, you are good to proceed to the next step.
**Note** If you are on a Windows machine and after running `docker-compose ps` all the drupal machines have an Exit status of 127, you will need to run `git config --global core.autocrlf false`. You will then need to delete the repo, re-clone it and run `docker-compose build` again.
Running `docker-compose up -d` will have created some folders within wcms-docker/build-scripts. To populate these folders you need to log in to the container you want to use.
Running "docker-compose up -d" will have created some folders within "wcms-docker/build-scripts". To populate these folders you need to log in to the container you want to use.
To "ssh" into the docker container e.g. `docker-compose exec drupal7 bash`:
To "ssh" into the docker container e.g. `docker-compose exec --user vagrant drupal7 bash`:
```bash
docker-compose exec <service name> bash
docker-compose exec --user vagrant <service name> bash
```
The current list of services are:
The current list of containers are:
* drupal7 - drupal7 container running PHP 5.6
* wcms7.2 - drupal7 container running PHP 7.2
* drupal7os - Open Scholar container
......@@ -155,19 +157,22 @@ The current list of services are:
## How to Install Your Site
Once you have logged in to the container, you will need to change to the vagrant user. To do this you enter `su vagrant` then, as the vagrant user you will need to run the `wcms-settings.sh` file which is located at `/var/www/wcms-settings`:
Once you have logged in to the container (if you are not already logged in as the vagrant user, enter `su vagrant`). As the vagrant user you will need to run the "wcms-settings-d<version-of-drupal>.sh" file which is located at `/var/www/wcms-settings`:
```bash
cd /var/www/wcms-settings
sudo ./wcms-settings.sh
sudo ./wcms-settings-d7.sh
```
You will be asked for the vagrant password, which is vagrant.
You will may be asked for the vagrant password, which is `vagrant`.
This file will then install drupal, clone our profile (for Drupal7), and setup the sites in the correct locations.
Once this is done you can access all the files in the local folder for the profile you are using e.g.`\wcms-docker\build-scripts\drupal7\drupal7_local\`
Once this is done you can access all the files in the local folder for the profile you are using e.g."\wcms-docker\build-scripts\drupal7\drupal7_local\"
You will need to do this for each container before you can install any sites.
Now, in a web browser you will need to go to `https://wcms7:4443/fdsu1/install.php` to build your drupal site.
Each service is assigned a specfic port:
Each container is assigned a specfic port:
* drupal7 - https://wcms7:4443
* wcms7.2 - https://wcms7:4444
* drupal7os - https://wcms7:4445
......@@ -176,11 +181,21 @@ Each service is assigned a specfic port:
## Troubleshooting
If you are running Portainer and you get this error:
```bash
un\\\\docker.sock:/var/run/docker.sock"\nis not a valid Windows path'
ERROR: for portainer Cannot create container for service portainer: b'Mount denied:\nThe source path "\\\\var\\\\run\\\\docker.sock:/var/run/docker.sock"\nis not a valid Windows path'
Encountered errors while bringing up the project.
```
You will need to use Windows Powershell (as Admin) and enter:
```bash
$Env:COMPOSE_CONVERT_WINDOWS_PATHS=1
```
Potential issue with Firefox and being able to resolve localhost:
https://www.reddit.com/r/sysadmin/comments/94r885/firefox_will_soon_be_sending_all_dns_requests_to/
......@@ -217,6 +232,8 @@ delete the content of the `_local` folders and start fresh.
For Patternlab in Drupal 8, you can access it (once you have Patternlab built) at https://localhost:4446/uw_wcms_pattern_lab/pattern-lab/public/
Most of the commands within the containers should be run as the vagrant user, as long as you log in using `docker-compose exec --user vagrant drupal7 bash` things should run okay.
## Xdebug and PHPStorm
Xdebug is installed as part of the containers, the only setup that should need to be done is in PHPStorm.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment