Score:0

Docker wordpress/ nginx-proxy / nginx-proxy-companion - lets encrypt auto renewal - update image and restart?

cn flag

I have a wordpress site on an aws ec2 that was setup (by someone else) to auto renew its SSL certificate via Let's Encrypt.

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 jrcs/letsencrypt-nginx-proxy-companion image has since been updated to handle this required change to the ACME client -- and that pulling the image and restarting the container with the new image would fix auto renewal.

If that's a correct assumption, how can I pull the latest jrcs/letsencrypt-nginx-proxy-companion image and restart the container without disturbing the volumes attached to the the wordpress or db services?

If it's an incorrect assumption, how do I fix the certificate auto renewal?

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:
Michael Hampton avatar
cz flag
Stop using the `latest` tag and then rebuild your containers.
ksav avatar
cn flag
@MichaelHampton so I should edit the image names to remove `:latest` from `docker-compose.yml` then run `docker-compose up -d`?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.