Create your first GipOps Compose file
Time Required
30 Minutes
Difficulty
Low
Create your first Compose file
In this example, we're going to massage the LinuxServer.io's Ombi image to match our best practices, per below
Create your Compose file
In this section we will create a compose file for the Omnitools app
Open your GitHub repo and enter the docker-compose folder
Click on 'Add file' > 'Create new file'
Name the file 'omnitools.yml', and copy the compose file from here It should look something like this:
services: omni-tools: image: iib0011/omni-tools:latest container_name: omni-tools restart: unless-stopped ports: - "8080:80"Hit 'Commit changes...'
hit 'Commit changes'
If you care, write some information about what you are doing
Navigate to your file and review its contents
Making changes and writing compose files
Copy and pasting other peoples compose files is great and all, but you are best to learn how to write and edit them yourself.
Syntax
Variables
To keep your compose files as system agnostic as possible, its best to use variables where you can. Some suggestions are
Ports
Volume paths
Labels
These variables can then be set in Portainer when creating the stack
Health Checks
Some containers come with health checks, some do not. After starting the stack, refer to the state. If it is "running", it does not have an inbuilt health check.
Website
If your app has a web-ui, you can test the below commands
Open up your stack and select the container
Click on the Console button
Attempt each command until you get access to the terminal
Click on the command dropdown and select the first option
Click on connect
Repeat until you have access to the terminal
Once you are connected, try the below commands. If you get "not found" or something similar, move onto the next one
curlwget
Add the below to your app. Do not forget to update the port
Database
Labels
Volumes
Container versioning
Do not use the 'latest' tag, as it does not allow Renovate to update the compose file, and if it automatically updates it may bring braking changes.
When versioning your compose files, locate the 'latest' tag on the DockerHub, GitHub etc and use the relevant version number.

This is harder to do on DockerHub. Per the screenshot below, we've located the 'latest' tag and used the digest version to locate the correct version.

Here is my tweaked example
Container Image locations
As Docker has now started rate limiting non-paying users, a lot of container creators are putting their containers on GitHub or other services
Its quite easy to figure out if a container exists on GitHub;
If the 'Packages' option exists, the container is on GitHub\

The container URL is underlined\

Last updated
Was this helpful?

