Inputs
💡 Click on the Input Name for more Details.
| Input Name | Default Value | Short Description |
|---|---|---|
| name * | - | Docker Stack/Project Name |
| file | docker-compose.yaml | Docker Stack/Compose File(s) |
| mode ¹ | swarm | Deploy Mode [swarm, compose] |
| args ¹ | --remove-orphans --force-recreate | Additional Compose Arguments |
| host * | - | Remote Docker Hostname or IP |
| port | 22 | Remote Docker Port |
| user * | - | Remote Docker Username |
| pass * | - | Remote Docker Password |
| ssh_key * | - | Remote SSH Key File |
| disable_keyscan | false | Disable SSH Keyscan ssh-keyscan |
| env_file | - | Exported Environment File |
| detach ² | true | Detach Flag, false, to disable |
| prune ² | false | Prune Flag, true, to enable |
| resolve_image ² | always | Resolve [always, changed, never] |
| registry_auth ² | false | Enable Registry Authentication |
| registry_host | - | Registry Authentication Host |
| registry_user | - | Registry Authentication Username |
| registry_pass | - | Registry Authentication Password |
| summary | true | Add Job Summary |
* Required, note pass/ssh_key are mutually exclusive.
¹ Compose Only, view the Compose Docs
² Swarm Only, view the Swarm Docs
Details
name Required
Swarm sack name or Compose project name.
Example: cool-stack
file
Stack file or Compose file(s).
Compose. Multiple files can be provided, space seperated, and the -f flag will be automatically prepended to each file.
Example: web.yaml db.yaml
Output: -f web.yaml -f db.yaml
Swarm. Only supports 1 file per stack.
Default: docker-compose.yaml
mode Compose Only
Set this to compose to use compose up for non-swarm hosts.
Default: swarm
args Compose Only
Compose arguments to pass to the compose up command. Only used for mode: compose deployments. The detach flag defaults to false for compose. With no args the default is --remove-orphans --force-recreate. Use an empty string to override. For more details, see the compose docs.
Default: --remove-orphans --force-recreate
host Required
The hostname or IP address of the remote docker server to deploy too. If your hostname is behind a proxy like Cloudflare you will need to use the IP address.
You may be able to find your Public IP with one of these commands.
curl ip.mecurl -4 ifconfig.coecho $(wget -qO- https://ipecho.net/plain)dig TXT +short o-o.myaddr.l.google.com @ns1.google.comport
SSH Port. Only set this if using a non-standard port.
Default: 22
user Required
SSH Username. This user must have permissions to access docker.
If you use sudo or the root user to access docker, it is recommended you grant docker access to another user or service account.
Replace mynewuser with your actual username.
sudo usermod -aG docker mynewuserAfter this you should be able to run docker commands as mynewuser without sudo. Note, you may need to log out and back in for the changes to take effect.
pass Required
You must provide either a pass or ssh_key, but not both.
When using a password, a temporary key is generated using ssh-keygen and copied to the host with ssh-copy-id using sshpass. The authorized_keys file entry is cleaned up after each deploy.
ssh_key Required
You must provide either a ssh_key or pass, but not both.
To generate an SSH key, run the following as the deployment user:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""
cat ~/.ssh/id_ed25519ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsadisable_keyscan
This will disable the ssh-keyscan command. Advanced usage only.
Enabling this will break deployments unless you know what you are doing.
Default: false
env_file
Variables in this file are exported before running stack deploy. If you need compose file templating this can also be done in a previous step.
Compose. You can also add to the args with --env-file stringArray
INFO
This is NOT the Docker compose env_file directive. That is set in your compose file as normal.
detach Swarm Only
Set this to false to not exit immediately and wait for the services to converge. This will generate extra output in the logs and is useful for debugging deployments.
Compose. The detach flag is implied in compose.
See the stack deploy Options for more details.
Default: true
prune
Prune services that are no longer referenced. Set to true to enable.
See the stack deploy Options for more details.
Default: false
resolve_image Swarm Only
Can be one of: [always, changed, never]
When the default always is used, this argument is omitted.
See the stack deploy Options for more details.
Default: always
registry_auth Swarm Only
Set to true to deploy with --with-registry-auth.
If setting registry_user/registry_pass this is implied.
See the stack deploy Options for more details.
Default: false
registry_host
To run docker login on another registry.
Example: ghcr.io
registry_pass
Required to run docker login before stack deploy.
registry_user
Required to run docker login before stack deploy.
summary
Write a Summary for the job. To disable this set to false.
For more information see Job Summary.
Default: true
