A Gamers Grind / XFGN / LM
Status
  • 🖥️www.agamersgrind.com
  • 🏙️--- Public Files ---
    • 👋Welcome, friends
    • ⛑️I need help!
    • ☕Buy me a Coffee
  • 📚Guides
    • Mini Guides
      • Valheim FPS Boost
      • Redirect domain to Google Site
      • Docker Compose
        • 'All' Compose File
        • Add Health Check to Container
        • Mount NFS Share to Container
        • Map hostname to container
    • Portainer and GitOps
      • Set up GitHub
      • Install Portainer
      • Create your first GipOps Compose file
      • Deploy your first GitOps stack
      • Managing your production compose files
    • Cloudflare
      • Domains
      • Generate an API Key
      • Tunnel
        • Create a Tunnel
        • Create a Proxy (Public Hostname)
        • Access Groups & Authentication
      • Dynamic DNS
    • Pterodactyl
      • Creating a new Panel
      • Creating a new Wings node
      • Join servers via domain
      • Configuring your Node Database
      • Server Best Practices & Suggestions
      • Troubleshooting
  • 🎮Game Servers
    • Valheim Public
    • Valheim Private
    • MultiMC (Minecraft)
    • CreateCraft (Minecraft)
    • Insurgency Sandstorm
  • ⚔️AGG Moderation
    • ❔Creating a new Server
    • Approving Valheim Application
  • 🗄️Internal Documentation
Powered by GitBook
On this page
  • Create your first Compose file
  • Create your Compose file
  • Best Practices and tips

Was this helpful?

  1. Guides
  2. Portainer and GitOps

Create your first GipOps Compose file

PreviousInstall PortainerNextDeploy your first GitOps stack

Last updated 1 year ago

Was this helpful?

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 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\

📚

Time Required

30 Minutes

Difficulty

Low

from here
Take note of the OS/ARCH as well - you can see that tag 2.12.5 contains both AMD64 and ARM64 containers, meaning this compose file can be used on both ARM and x86 machines.