Skip to content

Docker

Some projects include a docker-compose.yml for local development, so that they can be run using Docker containers rather than directly on your machine. This is especially useful for legacy projects running older versions of PHP.

This page covers the workflow for those projects.

Prerequisites

Install Docker Desktop and ensure the Docker daemon is running before continuing.

Shell aliases

Add these aliases to your shell profile (e.g. ~/.zshrc or ~/.bashrc) to reduce typing for the most common Compose commands:

bash
alias dcu='docker compose up -d'
alias dcd='docker compose kill && docker compose down'

Reload your shell after saving:

bash
source ~/.zshrc

TIP

If you are using oh-my-zsh, a good place to add aliases is $ZSH_CUSTOM/aliases.zsh.

AliasExpands toPurpose
dcudocker compose up -dStart all services in the background
dcddocker compose kill && docker compose downStop and remove all containers

Daily workflow

Start services when beginning work:

bash
dcu

Stop services when done:

bash
dcd

To tail logs for a specific service while working:

bash
docker compose logs -f <service>

Private registry

Projects that use our own Docker images pull them from the self-hosted registry at registry.morphserve.net. You need to authenticate once per machine.

Generate a GitLab access token

  1. Sign in to the GitLab instance.
  2. Go to User Settings → Access Tokens (top-right avatar menu).
  3. Create a new token with the read_registry scope. Give it a recognisable name such as docker-local.
  4. Copy the token – it is only shown once.

Log in to the registry

bash
docker login registry.morphserve.net

Enter your GitLab username and paste the access token as the password when prompted. Docker stores the credential in your system keychain so you only need to do this once.

Verify access

Pull any image the project uses to confirm authentication is working:

bash
docker pull registry.morphserve.net/<namespace>/<image>:<tag>

If the pull succeeds, you are ready to run the project with dcu.