buchdag / multiarch-letsencrypt-nginx-proxy

nginx-proxy, docker-gen and letsencrypt-nginx-proxy-companion on arm archs
MIT License
23 stars 8 forks source link

"Error: nginx-proxy container isn't running" on Nextcloud setup #4

Closed Mr5quid closed 6 years ago

Mr5quid commented 6 years ago

Hi,

I'm working on a server setup on my Odroid XU4 (armv7 32bits) running ArchArm which includes Nextcloud-fpm with an nginx web server, a postgres container and of course the letsencrypt-nginx-proxy-companion bundled with the nginx-proxy from this repo. I'm pretty new at docker so I basically did a mix of the Nextcloud Docker installation guide's docker-compose file and the docker-compose for the 2-containers-setup from this repo:

version: '3'

services:
  db:
    image: postgres
    restart: always
    volumes:
      - db:/var/lib/postgresql/data
    env_file:
      - db.env

  app:
    image: nextcloud:fpm
    restart: always
    volumes:
      - nextcloud:/var/www/html
    environment:
      - POSTGRES_HOST=db
    env_file:
      - db.env
    depends_on:
      - db

  web:
    build: ./web
    restart: always
    volumes:
      - nextcloud:/var/www/html:ro
    environment:
      - VIRTUAL_HOST=cloud.example.org
      - LETSENCRYPT_HOST=cloud.example.org
      - LETSENCRYPT_EMAIL=user@email.com
    depends_on:
      - app
    networks:
      - proxy-tier
      - default

  nginx-proxy:
    build: ./nginx-proxy
    image: nginx-proxy
    container_name: nginx-proxy
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - dhparam:/etc/nginx/dhparam
      - conf:/etc/nginx/conf.d
    networks:
      - proxy-tier

  letsencrypt:
    build: ./letsencrypt-nginx-proxy-companion
    image: letsencrypt-nginx-proxy-companion
    container_name: nginx-proxy-le
    restart: always
    volumes:
      - vhost.d:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - dhparam:/etc/nginx/dhparam
      - conf:/etc/nginx/conf.d
    networks:
      - proxy-tier
    depends_on:
      - nginx-proxy

volumes:
  db:
  nextcloud:
  vhost.d:
  html:
  certs:
  dhparam:
  conf:

networks:
  proxy-tier:

And so it started, I had openssl eating up two cpu threads for quite a while and then it finished but since then my server is only accessible through HTTP on port 80. There's no trace of an SSL cert.

Checking up the docker-compose logs I first have this error at the beginning : nginx-proxy-le | 2018/07/26 21:30:23 Error: nginx-proxy container dc2a0f4851cd5a2451a53b8e395f84d89cb677b2bf7d7184f4785216983fa139 isn't running.

The complete logs are available here : https://bin.disroot.org/?8351bc21b6ffc09b#Hj320WtqokB69t212DdSB9EOjQf4B4yjVdDNlpfFaR4=

When idle it pretty much loops on that.

Like I said I'm running ArchArm on the Odroid XU4 with an armv7l architecture.

# docker-compose version
docker-compose version 1.22.0, build unknown
docker-py version: 3.4.1
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.1.0h  27 Mar 2018

Any help would be greatly appreciated ! I'm very excited about this setup for which I plan to migrate my non-dockerized XMPP server to soon.

buchdag commented 6 years ago

Hi. Your compose file seems to lack a way to make the letsencrypt container aware of the nginx-proxy container ID. Please see https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/wiki/Docker-Compose#getting-containers-ids

Mr5quid commented 6 years ago

Hi @buchdag and thank you for your answer. That's right I was missing something. My first version had the label though but it still didn't go very well. Either way, I purged up all images, containers and volumes and started again with that compose file to which I added the NGINX_PROXY_CONTAINER=nginx-proxy env var and it's now up and running ! It's really great.

By the way, thank you for bringing these awesome images on ARM architectures. It made my day when I found it.