Companion Git Repositories are a legacy mechanism! There is now an easier way to provide Procfiles and
.aptible.yml
when deploying from Docker Image. In practice, this means you should not need to use a companion git repository anymore. For more information, review Procfiles and .aptible.yml
with Direct Docker Image Deploy. Using a Companion Git Repository
Some features supported by Aptible don’t map perfectly to Docker Images. Specifically: You can however use those along with Direct Docker Image Deploy by adding a Companion Git Repository.Providing a Procfile
When you deploy directly from a Docker image, Aptible uses your image’sCMD
to know which service command to run, you can create a separate App, or add a Procfile via a companion git repository.
To do so, create a new empty git repository containing a Procfile, and include all your services in the Procfile.
For example:
master
branch to trigger a deploy:
Providing .aptible.yml
When you deploy directly from a Docker Image, you don’t normally use a git repository associated with your app. This means you don’t have a.aptible.yml
file.
Generally, we recommend architecting your app to avoid the need for a .aptible.yml file when using Direct Docker Image deploy, but if you’d like to use one nonetheless, you can.
To do so, create new empty git repository containing a .aptible.yml file, and include your desired configuration in it.
For example:
master
branch to trigger a deploy:
before_release
commands;
Synchronizing git and Docker image deploys
If you are using a companion git repository to complement your Direct Docker Image deploy with a Procfile and/or a .aptible.yml file, you can synchronize their deploys. To do so, push the updated Procfile and/or .aptible.yml files to a branch on Aptible that is not master. For example:aptible deploy
, but add the --git-commitish
argument, like so:
$BRANCH
represents the remote branch you pushed your updated files to. In the git push
example above, that’s update-the-Procfile
.