This post picks up from where Configuring DGDocker2 left off. In it I will establish a workflow to setup a “Dockerized” server complete with Traefik, Portainer, and Who Am I. It should be relatively easy to add additional non-static services to any server that is initially configured using this package. For “static” servers have a look at post 008 docker-bootstrap Workflow .
Capture As a Project
Picking up from the end of Configuring DGDocker2, my first step on the dgdocker2 server was to move everything into a single subdirectory of /opt; I called the new directory dockerized-server, like so:
To avoid additional rate-limit issues with Let’s Encrypt, I’m going to switch to using their “staging” server. That requires the addition of this snippet to our /opt/dockerized-server/traefik/traefik.toml file:
# CA server to use
# Uncomment the line to run on the staging Let's Encrypt server
# Leave comment to go to prod
caServer = "https://acme-staging.api.letsencrypt.org/directory"
A Fresh Start
Now, all that’s required to spin up the new server with the aforementioned parts, in this case on dgdocker2, is a command sequence like this:
# Clean up first!
docker stop $(docker ps -q); docker rm -v $(docker ps -qa); docker image rm -f $(docker image ls -q); docker system prune --force;
# Navigate into the project
docker network create web
docker-compose --log-level DEBUG up -d
A Quick Test
Since the above command sequence produced no errors, it’s time to test what we have. The expectation is that our three services should now be running on dgdocker2, and they should respond in any web browser at the addresses shown here:
Confirmed! All of the above are working properly, albeit with invalid/temporary certs (due to Let’s Encrypt rate limiting).
Pushing to GitHub
No project is complete these days without a GitHub component (or something very similar). So, my next step was to create a new GitHub repository at https://github.com/DigitalGrinnell/dockerized-server, and push the contents of my dgdocker2:/opt/dockerized-server directory to it, like so: