Docker compose file will not install on portainer

I am trying to install nginx proxy manager. I checked my compose file using https://www.yamllint.com/ and was told this is a valid yaml file.

version: "3.8"
services:
  nginxproxymanager:
    image: jc21/nginx-proxy-manager:latest
    container_name: nginxproxymanager
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
      - 81:81
    environment:
      - PUID=1003
      - PGID=1003
      - DB_SQLITE_FILE: /data/database.sqlite
    volumes:
      - /docker/nginx_proxy_manager/data:/data
      - /docker/nginx_proxy_manager/letsencrypt:/etc/letsencrypt

However when I paste this into portainer stacks and try to deploy I get the following error.

failed to deploy a stack: validating /data/compose/27/docker-compose.yml: 
services.nginx_proxy_manager.environment.2 must be a string

I have not been able to find anything to help me understand what I’m doing wrong.
thanks,
GF

1 Like

Of course, it’s a valid yaml.

But with compose you can either declare your environments as map or as string list, but you can’t mix it.

as map

    environment:
      PUID: '1003'
      PGID: '1003'
      DB_SQLITE_FILE: '/data/database.sqlite'

as string list:

    environment:
      - PUID=1003
      - PGID=1003
      - DB_SQLITE_FILE=/data/database.sqlite
2 Likes

Thanks for your time! Thanks for the information very helpful!

1 Like