I use statping in combination with nginx-proxy. In the latest update statping introduced the env variables LETSENCRYPT_HOST and LETSENCRYPT_EMAIL.
ningx-proxy use the env variables to config the reverse proxy and the config for Let's Encrypt. Due to the env variables staping now starts with Let's Encrypt and try to get an cert. In my case this cause an error and I can't use staping anymore.
Start stateping in a docker env with nginx-proxy. My docker-compose.yml:
version: '3.7'
services:
statping:
image: statping/statping
restart: unless-stopped
volumes:
- ./data/app:/app
depends_on:
- postgres
environment:
DOMAIN: https://$HOSTcd
VIRTUAL_HOST: $HOST
LETSENCRYPT_HOST: $HOST
LETSENCRYPT_EMAIL: $EMAIL
VIRTUAL_PORT: 8080
DB_CONN: postgres
DB_HOST: postgres
DB_DATABASE: statping
DB_USER: statping
DB_PASS: $DB_PASS
postgres:
container_name: postgres
image: postgres:11-alpine
restart: unless-stopped
volumes:
- ./data/postgres:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: $DB_PASS
POSTGRES_DB: statping
POSTGRES_USER: statping
POSTGRES_DB: statping
nginx-proxy:
image: jwilder/nginx-proxy:alpine
container_name: nginx-proxy
restart: always
ports:
- '80:80'
- '443:443'
environment:
- ENABLE_IPV6=true
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
volumes:
- '/var/run/docker.sock:/tmp/docker.sock:ro'
- './data/nginx-proxy-certs:/etc/nginx/certs:ro'
- 'nginx-config:/etc/nginx/conf.d'
- './data/nginx/vhost.d:/etc/nginx/vhost.d'
- 'nginx-webroot:/usr/share/nginx/html'
- './data/nginx/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro'
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
restart: always
networks:
- default
environment:
DEFAULT_EMAIL: $EMAIL
volumes:
- './data/nginx-proxy-certs:/etc/nginx/certs'
- '/var/run/docker.sock:/var/run/docker.sock:ro'
- 'nginx-config:/etc/nginx/conf.d'
- './data/nginx/vhost.d:/etc/nginx/vhost.d'
- 'nginx-webroot:/usr/share/nginx/html'
volumes:
nginx-config:
nginx-webroot:
The Let's Encrypt env variable a pretty new. Maybe you have the chance to rename the variables. An alternative could be also to add a new variable to disable Let's Encrypt of stateping.
Ahhh, I used to use jwilder's nginx-proxy, didn't think about the collision though. I'll add a new variable to enable/disable LetsEncrypt.
I just merged a PR to fix this issue, set LETSENCRYPT_ENABLE to true if you want to have Statping generate the SSL cert. PR: https://github.com/statping/statping/pull/749
Thanks for the quick fix. Perhaps the readme needs an update. I guess the example needs the new LETSENCRYPT_ENABLE=true variable, right?
https://github.com/statping/statping#docker-compose-with-automatic-ssl
Ahhh i'll update that page too, I just updated the SSL Wiki. The latest version (v0.90.60) is currently building.
By default, LETSENCRYPT_ENABLE=false
On version 0.90.60.
Most helpful comment
Ahhh, I used to use jwilder's nginx-proxy, didn't think about the collision though. I'll add a new variable to enable/disable LetsEncrypt.
I just merged a PR to fix this issue, set
LETSENCRYPT_ENABLEto true if you want to have Statping generate the SSL cert. PR: https://github.com/statping/statping/pull/749