dockerdocker-composelets-encryptcoreosjwilder-nginx-proxy

ERROR: In file './docker-compose.yml', service name True must be a quoted string, i.e. 'True'


My docker-compose.yml looks like the below. When i run docker-compose up I get the below error.

ERROR: In file './docker-compose.yml', the service name True must be a quoted string, i.e. 'True'.

version: '3'
services:

  db:
    restart: always
    image: postgres:9.6-alpine
    container_name: pleroma_postgres
    networks:
      - pleroma
    volumes:
      - ./postgres:/var/lib/postgresql/data

  web:
    build: .
    image: pleroma
    container_name: pleroma_web
    restart: always
    environment:
      - VIRTUAL_HOST=<myplaceholderhost>
      - VIRTUAL_PORT=4000
      - LETSENCRYPT_HOST=<myplaceholderhost>
      - LETENCRYPT_EMAIL=<myplaceholderemail>
    expose:
      - "4000"
    volumes:
      - ./uploads:/pleroma/uploads
    depends_on:
      - db

  nginx: 
    image: jwilder/nginx-proxy
    container_name: nginx
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
      - /apps/docker-articles/nginx/certs:/etc/nginx/certs:ro
      - /apps/docker-articles/nginx/html:/usr/share/nginx/html
    restart: always
    ports:
      - "80:80"
      - "443:443"
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    networks:
      - pleroma

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion:v1.5
    container_name: letsencrypt
    volumes_from:
      - nginx
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
      - /apps/docker/articles/nginx/certs:/etc/nginx/certs:rw
      - /apps/docker-articles/nginx/html:/usr/share/nginx/html

networks:
  pleroma:

My docker version is

Docker version 18.06.1-ce, build e68fc7a

My docker compose version is

docker-compose version 1.23.1, build b02f1306

Running CoreOS version 1911.3.0


Solution

  • I ended up resolving this issue by modifying the nginx and letsencrypt portions of my docker-compose.yml file to be as follows.

     nginx: 
        image: jwilder/nginx-proxy
        container_name: nginx
        volumes:
          - /var/run/docker.sock:/tmp/docker.sock:ro
          - /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
          - /apps/docker-articles/nginx/certs:/etc/nginx/certs:ro
          - /apps/docker-articles/nginx/html:/usr/share/nginx/html
        restart: always
        ports:
          - "80:80"
          - "443:443"
        labels:
          - "NGINX_PROXY_CONTAINER=true"
        networks:
          - pleroma
    
      letsencrypt:
        image: jrcs/letsencrypt-nginx-proxy-companion:v1.5
        container_name: letsencrypt
        environment:
          - NGINX_PROXY_CONTAINER=true
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
          - /apps/docker/articles/nginx/certs:/etc/nginx/certs:rw
          - /apps/docker-articles/nginx/html:/usr/share/nginx/html
    

    It seems "volumes_from" is deprecated in docker-compose v3. As well as I had forgotted quotes around my label and needed to set my environment within letsencrypt.