Skip to content

Docker Compose

Docker Compose is used to deploy certain applications in my Homelab. The docker directory contains subdirectories for each application.

Environment Variables

Each directory contains a .env file which references secrets from a 1Password Vault. On the Docker host, the op CLI is configured to authenticate with a 1Password Service Account. The secret references are then substituted at runtime when using the op run command.

Deployment

Info

The example commands below are for Caddy, but the process is identical for the other application directories.

  1. Copy the application directory to the Docker host:

    scp -r caddy [email protected]:~/
    
  2. SSH to the Docker host:

  3. Deploy the application:

    cd caddy && op run --env-file=./.env -- docker compose up -d