Phil4real

joined 1 year ago
 

I'm using Community Edition trying to use 'Stacks' which resides on a proxmox node.

I'm a bit confused how to read in config files to portainer from either a git repo or locally.

For example, I have this example in my docker-compose.yml file where I read in a config file in the same directory called 'prometheus.yml':

version: '3'

services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--web.enable-lifecycle'
    ports:
      - 9090:9090
    restart: unless-stopped
    volumes:
      - /home/phil/gitrepos/prometheusTesting/:/etc/prometheus/
      - prom_data:/prometheus
volumes:
  prom_data:

The stack launched but then in the container log I saw this error:

ts=2023-11-26T18:36:49.719Z caller=main.go:487 level=error msg="Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="read /etc/prometheus/prometheus.yml: is a directory"

I also tried via git repository but portainer complaine about the relative path which has thrown me because I thought portainer would just clone the repo and run as is..

version: '3'

services:
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--web.enable-lifecycle'
    ports:
      - 9091:9091
    restart: unless-stopped
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prom_data:/prometheus

So.. How do I handle passing in these config files? Any examples would be super useful.