Go to file
Andreas Oberritter 173fd97ac8 docker_compose_command: Accept 'docker compose' in config
By splitting the command, we create a list that can be used
with subprocess.run(). This allows to use simple paths as
well as command-lines like "docker compose" to be specified
in compose_executable. It also allows to pass more arguments
to the process.

This doesn't take into account any logic used by shells to
quote strings or escape characters. We could use shlex.split()
instead, if that's required.
2023-02-11 11:25:46 +01:00
doxy docker_compose_command: Accept 'docker compose' in config 2023-02-11 11:25:46 +01:00
tests Preparing pre-commit setup 2023-01-10 15:45:35 +01:00
.gitignore Initial commit 2023-01-10 08:57:57 +01:00
.pre-commit-config.yaml Installing pre-commit hook 2023-01-10 15:46:17 +01:00
README.md Code formatting 2023-01-16 14:42:00 +01:00
config.example.yml Handle missing configuration file. 2023-01-12 08:43:44 +01:00
poetry.lock Added command aliases 2023-01-18 11:30:35 +01:00
pyproject.toml Added command aliases 2023-01-18 11:30:35 +01:00

README.md

Doxy

Installation

pipx install git+https://github.com/jaypikay/doxy.git

Shell completion

Service name completion

By enabling shell completion the service names are TAB-Completted when using the control command.

Configuration

Save the configuration file in ~/.config/doxy/config.yml:

root_directory: "/path/to/docker/services"
compose_executable: "/usr/bin/docker-compose"

If you use docker compose instead of docker-compose you can use a wrapper script for docker-compose

#!/bin/bash

/usr/bin/docker compose $@

exit 0

Usage

Usage: doxy [OPTIONS] COMMAND [ARGS]...

Options:
  -f, --format [fancy|simple]  output formatting  [default: fancy]
  --help  Show this message and exit.

Commands:
  control  run docker-compose commands
  edit     edit the compose file
  list     list available services
  update   pull the latest service images and restart

Examples

List available services

$ doxy list
Available Services
├── service-1
├── service-2
├── other-service
└── my-service-demo

When doxy -f simple is used the output is easier to process by pipes.

Start a service and detach

$ doxy control other-service up -d

Edit a service

$ doxy edit service-2

Bash

Alternative 1

Add this to ~/.bashrc:

eval "$(_DOXY_COMPLETE=bash_source doxy)"

Alternative 2

Save the script:

_DOXY_COMPLETE=bash_source doxy > ~/.doxy-complete.bash

Add this to ~/.bashrc:

. ~/.foo-bar-complete.bash

Zsh

Alternative 1

Add this to ~/.zshrc:

eval "$(_DOXY_COMPLETE=zsh_source doxy)"

Alternative 2

Save the script:

_DOXY_COMPLETE=zsh_source doxy > ~/.doxy-complete.zsh

Add this to ~/.zshrc:

. ~/.foo-bar-complete.zsh