Docker Services

All the user-facing services in this lab setup are deployed using Docker Containers.

Docker helps developers build, share, run, and verify applications anywhere — without tedious environment configuration or management.

For additional services to host, check awesome-selfhosted.

Directory structure

  • docker – Docker-based service configuration
    • docker/hosts – Host specific service configuration
    • docker/stacks – Docker Compose files organized into categories

Host-specific configuration

In the docker/hosts subfolder multiple Docker hosts can be defined.

Configuration files:

  • Host-specific settings: docker/hosts/<hostname>/.env -> See [Setting Started -> Configure Docker environment files][setup] for more details. (These files are not committed to the repo - backup them separately!)
  • Configure which services to start (up function) or stop (down function): docker/hosts/<hostname>/apply.sh

Services

The applications/services are defined in the docker/stacks folder, ordered by category.
If possible, avoid any hardcoded configuration values in these files. Use environment variables and init containers for customization.

Start the services

After configuration, execute on a Docker host to apply the local configuration (based on the hostname): task docker:apply or docker/apply-local.sh

Updates

Updating the container image tags is automated with Renovate.

Check for updates (only useful for containers not having a fixed version tag): task docker:check-updates or docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once --cleanup --monitor-only

Update containers having non-fixed version tags: task docker:update or MODE=UPDATE docker/apply-local.sh

Tips

Convert docker run commands to docker compose format:

Use ctop to monitor containers from the command-line.

Use the Docker VS Code Extension easy to build, manage, and deploy containerized applications from Visual Studio Code.

Use the Remote - SSH VS Code Extension to work on a remote machine.
Use the “Remote-SSH: Connect to Host” command to initiate a connection.
Read more: Remote Development using SSH