Deploy your first GitOps stack
Last updated
Last updated
Stacks is how Portainer handles Docker Compose files, which are infrastructure as code documents for spinning up multiple containers, volumes and networks in 1 go.
Most docker container developers now provide example compose files with their projects. Its also possible to Google and find examples online
For example, you may have a service that has a separate container for
a database
a web app
back end compute
The database and back end compute may be on Network 1, while the web app is on Network 2.
All 3 containers have access to the same 'config' volume, but the database and webapp have their own unique volumes
The database and backend need the same credentials to the 2 systems can talk, but the web app has separate credentials for the gui. These are environmental variables
Instead of manually setting up and inputting environmental variables, networks and volumes for each container this can all be written into the compose and and span up in 1 click. This also makes the set up system agnostic.
In this practice, we're going to deploy the Ombi compose file we created in Create your first GipOps Compose file
Log into Portainer
If you set up Edge Agents, click on the host you want Ombi to exist on
On the left hand menu, select 'Stacks'
Click on 'Add stack'
Give your stack a name (eg "ombi")
Build method = Repository
Tick 'Authentication'
Username = Github Email
Repository URL = the URL of your repo + .git (eg "https://github.com/trentnbauer/agg.local.git_"_)
Compose path = docker-compose/ombi.yml
Tick 'Automatic updates' You should see a page similar to this,\
Scroll down to the 'environment variables' section and add the following variables
TZ
BASE_URL
PORT_HTTP
Provide your TZ per the 'tz identifier' here
Provide a base url, if you are using one (not required)
Provide the port that Ombi will use
Click on 'Deploy the stack'
If you have any issues, refer to the Notifications tab at the top of the page;
Most Portainer errors can be resolved with a simple Google search but I also have my own troubleshooting list here
Time Required
30 Minutes
Difficulty
Low