Docker wordpress with nginx-proxy – nginx-proxy-companion for lets encrypt auto renewal – update image and restart

  docker, jwilder-nginx-proxy, nginx

We have a wordpress site on an aws ec2 that was setup with an auto renewing Let’s Encrypt SSL certificate.

The auto renewal has recently stopped and the certificate has since expired.

I have attempting to run docker exec {container_id} /app/force_renew but received this error:

ACME server returned an error: urn:acme:error:serverInternal :: The server experienced an internal error :: ACMEv1 is deprecated and you can no longer get certificates from this endpoint. Please use the ACMEv2 endpoint, you may need to update your ACME client software to do so. Visit https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430/27 for more information.

I have assumed that the jwilder/nginx-proxy image has since been updated to handle this required change.

What’s the best way to update the jwilder/nginx-proxy image and restart the container without disturbing the wordpress container.

version: '3.1'
services:
  nginx-proxy:
    container_name: nginx-proxy
    image: jwilder/nginx-proxy:latest
    restart: always
    ports:
      - 80:80
      - 443:443
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - dhparam:/etc/nginx/dhparam
      - certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
  nginx-proxy-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion:latest
    restart: always
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      - dhparam:/etc/nginx/dhparam
      - certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    depends_on:
      - nginx-proxy
    environment:
      DEFAULT_EMAIL: [email protected]
      NGINX_PROXY_CONTAINER: nginx-proxy
  wordpress:
    image: wordpress
    restart: always
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: myuser
      WORDPRESS_DB_PASSWORD: mypass
      WORDPRESS_DB_NAME: mydb
      VIRTUAL_HOST: mysite.com
      LETSENCRYPT_HOST: mysite.com
    volumes:
      - ./wp-content:/var/www/html/wp-content
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: mydb
      MYSQL_USER: myuser
      MYSQL_PASSWORD: mypass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'
    volumes:
      - ./mysql-data:/var/lib/mysql
    command: mysqld --sql-mode=""
volumes:
  conf:
  vhost:
  html:
  dhparam:
  certs:

Source: Docker Questions

LEAVE A COMMENT