This guide assumes you are comfortable enough running terminal (bash) commands on a Linux Computer.
We made sure that you can copy
and paste
each of these commands from this guide directly into your terminal.
You will notice sometimes commands span more than a single line of text. If that is the case, always make sure you copy
and paste a single line at a time and press the Enter
key afterwards. We suggest also you look at the output.
If something fails (and we hope it does not) troubleshooting will be much easier if you can share that output when asking for help.
Happy deploying!
- At least 10 Gbytes of free space (to get started)
- Some basic Unix/Terminal Skills
- 2-4 Gbytes of RAM
- Install Docker if you don't have it already by running:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${USER}
Log out, log in again!
sudo apt install docker-compose
Git tools are included by default in Ubuntu 18.04
If so, let's give that hard working repository a break first. If not, Step 1:
- Open a terminal (you have that already right?) and go to your previous download/git clone folder and run:
docker-compose down
docker-compose rm
- Can't remember where you downloaded it? Ok. We can deal with that!
Let's stop the containers gracefully first, run:
docker stop esmero-web
docker stop esmero-solr
docker stop esmero-db
docker stop esmero-cantaloupe
Now we need to remove them, run:
docker rm esmero-web
docker rm esmero-solr
docker rm esmero-db
docker rm esmero-cantaloupe
Ok, now we are ready to start.
Prefer to watch a video of how to install? Go to our user contributed documentation
!
If you run docker-compose
as root user (using sudo
) some enviromental variables, like the current folder used inside the docker-compose.yml
to mount the Volumens will not work and you will see a bunch of errors.
There are two possible solutions.
- The best is to add your user to the docker group (so no
sudo
needed). - Second option is to replace every
{$PWD}
inside yourdocker-compose.yml
with either the full path to your current folder, or with a.
and wrap that whole line in double quotes, basically making the paths for volumens relatives.
Instead of: - ${PWD}:/var/www/html:cached
use: - ".:/var/www/html:cached"
Now that you got it, lets deploy:
git clone https://github.com/esmero/archipelago-deployment.git archipelago-deployment
cd archipelago-deployment
git checkout 8.x-1.0-beta2
cp docker-compose-nginx.yml docker-compose.yml
docker-compose up -d
Note: docker-compose.yml
is git ignored in case you make local adjustments or changes to it.
You need to make sure Docker can read/write to your local Drive a.k.a mounted volumens (specially if you decided not to run it as root
, because we told you so!)
This means in practice running:
sudo chown -R 100:100 persistent/iiifcache
sudo chown -R 8983:8983 persistent/solrcore
And then
docker exec -ti esmero-php bash -c "chown -R www-data:www-data private"
Question: why this last command different: Answer: Just a variation. Long answer is the internal www-data
user in that container (Alpine Linux) has uid:82, but on ubuntu the www-data user has a different one so we let docker assing the uid from inside instead. In practice you could also run directly sudo chown -R 82:82 private
which would only apply to an Alpine use case, which can differ in the future! Does this make sense? No worries if not.
Once all containers are up and running (you can do a docker ps
to check),
access http://localhost:9000
using your most loved Web Browser with the following credentials:
user:minio
pass:minio123
and create a bucket named "archipelago". To do so press the red/coral +
button on the bottom-right side and press the Bucket
icon , it has a tooltip that says "create bucket". Write archipelago
and submit, done! That is where we will persist all your Files and also your File copies of each Digital Object. You can always go there and explore what Archipelago (well really Strawberryfield does the hard work) has persisted so you can get comfortable with our architecture.
The following will run composer inside the esmero-php container to download all dependencies and Drupal Core too.
docker exec -ti esmero-php bash -c "composer install"
You will see a warning: Do not run Composer as root/super user! See https://getcomposer.org/root for details
and the a long list of PHP packages, don't worry, all is good here, keep following the instructions! Once that command finishes run our setup script:
docker exec -ti esmero-php bash -c 'scripts/archipelago/setup.sh'
Explanation: That script will append some important configurations to your local web/sites/default/settings.php
.
Note: We say local
because your whole Drupal web root (the one you cloned) is also mounted inside the esmero-php and esmero-web containers. So edits to, e.g PHP files, can be done without accessing the container directly from your local folder.
If this is the first time you Deploy Drupal using the provided Configurations run:
docker exec -ti esmero-php bash -c "cd web;../vendor/bin/drush -y si --verbose config_installer config_installer_sync_configure_form.sync_directory=/var/www/html/config/sync/ --db-url=mysql://root:esmerodb@esmero-db/drupal8 --account-name=admin --account-pass=archipelago -r=/var/www/html/web --sites-subdir=default --notify=false install_configure_form.enable_update_status_module=NULL install_configure_form.enable_update_status_emails=NULL;drush cr;chown -R www-data:www-data sites;"
This will give you an admin
Drupal user with archipelago
as password (!change this if running on a public instance!) and also set the right Docker Container owner for your Drupal installation files.
Note: About Steps 2-3, you don't need to/nor should do this more than once. You can destroy/stop/update and recreated your Docker containers and start again, git pull
and your Drupal and Data will persist once you passed Installation complete
message. I repeat, all other container's data is persistet inside the persistent/
folder contained in this cloned git repository. Drupal and all its code is visible, editable and stable inside your web/
folder.
docker exec -ti esmero-php bash -c 'drush ucrt demo --password="demo"; drush urol metadata_pro "demo"'
docker exec -ti esmero-php bash -c 'drush ucrt jsonapi --password="jsonapi"; drush urol metadata_pro "jsonapi"'
Archipelago is more fun without having to start writing Metadata Displays (in Twig) before you know what they actually are. Since you should now have a jsonapi
user and jsonapi should be enabled, you can use that awesome functionality of D8 to get that done. We have 4 demo Metadata Display Entities that go well with the demo Webform we provided. To do that execute in your shell (copy and paste)
docker exec -ti esmero-php bash -c 'scripts/archipelago/deploy.sh'
You are done! Open your most loved Web Browser and point it to http://localhost:8001
Note: It can take some time to start the first time (Drupal needs some warming up). The Ubuntu deployment is WAY faster than the OSX deployment because of the way the bind mount volumens are handled by the driver. Our experience is that Archipelago basically reacts instantly!
If you see any issues or errors or need help with a step, please let us know (ASAP!). You can either open an issue
in this repository or use the Google Group. We are here to help.
This is our second beta release and still lots @TODOS
ahead before we are ready for a full 8.x-1.0
, we are pretty excited about how far we have gotten in the last 14 months, since we made the first pieces of code public. If you like this, let us know!
Installing Archipelago on AWS Ubuntu by Zach Spalding: https://youtu.be/RBy7UMxSmyQ