This blog is implemented in Pharo and is the natural choice for my Docker
example application. I already have a Smalltalk snippet to load this blog's
code and its dependencies into a pristine Pharo image, so I'll be using
that. Also, as a matter of course, I build the Pharo VM from source, and my
VM installation also contains self-built shared libraries like libsqlite.so
Outside of Docker, prepare a custom Pharo image:
gofaro is a simple shell script which purpose is to make sure the Pharo VM
loads my custom shared libraries, co-located with the standard VM files, at
loadSCMS1.st looks like this:
Before describing my Dockerfile, here are my conventions for inside the
VM goes into /pkg/vm.
Application artifacts including the image and changes files go into /pkg/image.
For this blog application, the blog's content is in /pkg/cms.
Starting with Ubuntu 18.04, install libfreetype6. The other lines are
copied from Torsten's tutorial.
Next, install the Pharo VM.
Now copy over the prepared Pharo image.
Finally, set the Docker container running. Here we create a UID/GID pair to
run the application. Said UID owns the mutable Pharo files in /pkg/image
and also the /pkg/image directory itself, in case the application needs to
create other files such as SQLite databases.
runSCMS1.st runs the blog application. In my current non-Dockerized
installation, the runSCMS1.st-equivalent snippet is in a workspace; for
Docker, to become DevOps/agile/CI/CD buzzwords-compliant, this snippet is
run from the command line. This is one Dockerization adaptation I had to
make to my application.
Now we build the Docker image.
The Docker image has been created, but it is not ready to run yet, because
the web content is not in the image. I'll put the content in a Docker
volume. Below, the first -v
mounts my host's content directory into /tmp/webcontent in the container;
the second -v mounts the volume smdw-content into /pkg/cms in the
container; I'm running the busybox image to get a shell prompt; and within
the container I copy the web content from the source to the destination.
Finally, run the Docker image, taking care to mount the volume
smdw-content, now with this blog's content:
Verified with a web browser. This works on my computer. :-)
MelcGraph is a graph algorithm
library by Ciprian Teodorov. I've updated the package to handle the
deprecation of #name, using 'label' in place of 'name' as inst-var and in
selectors. Thanks Ciprian for giving me commit access to the repo.
I've finally gotten around to building a "mobile-first responsive" version
of this website. Still powered by Pharo Smalltalk and Seaside, using
Bootstrap 3, for the responsive HTML templating.
football.db's data is described in YAML files which are assembled into
SQLite databases using tools written in Ruby. From the constructed 2014 and
2018 World Cup databases, I've created SQL dumps and placed them in the
repo. To get an SQLite database from the 2018 SQL dump file:
In its current state, footballdb-Glorp allows querying the initial World Cup
first round group membership.
This Glorp descriptor may not be completed in time for this World
Cup which is starting in a few days, but will be in time for the next
one for sure! :-) Load it thusly: