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

  1. Open your GitHub repo and enter the docker-compose folder

  2. Click on 'Add file' > 'Create new file'

  3. Name the file 'ombi.yml', and copy the compose file from here It should look something like this:

  4. Refer to the best practices and tips documentation below and edit the file

  5. Hit 'Commit changes...'

  6. hit 'Commit changes'

Oh, you want me to give you the answer to step 4?

As of writing, here is the ombi.yml compose file

original-ombi.yml
---
version: "2.1"
services:
  ombi:
    image: 
    
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=
      - BASE_URL=/ #optional
    volumes:
      -
    ports:
      - :3579
    restart: unless-stopped

Here is my tweaked file

bestpractice-ombi.yml
---
version: "2.1"
services:
  ombi:
    image: 
    
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=
      - BASE_URL=/ #optional
    volumes:
      - 
    ports:
      - :3579
    restart: unless-stopped

Best Practices and tips

Variables

To keep your compose files as system agnostic as possible, its best to use variables where you can. Some suggestions are

  • Ports (eg $HTTP_PORT, $DB_PORT, $API_PORT)

  • Mounted volumes (eg $CONFIG, $DATA)

  • Timezones (eg $TZ)

These variables can then be set in Portainer when creating the stack

Don't name containers unless there is a requirement for it

Some compose files may name a database 'db', which will then block you from using that name anywhere else. Its best to let Portainer manage names of containers.

Container Image versioning

Do not use the 'latest' tag, as it does not allow Renovate to update the compose file

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 'tatest' tag and used the Digest to locate the correct version.

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;

  1. If the 'Packages' option exists, the container is on GitHub\

  2. The container URL is underlined\

Last updated