Production-ready Nginx 1.30 Alpine image with Certbot, automated renewal and ACME webroot support.
209
A lightweight custom Nginx 1.30 image with built-in Certbot support for Let's Encrypt SSL certificates.
This image is based on nginx:1.30.2-alpine and is intended for simple self-hosted reverse proxy setups where Nginx and Certbot run inside the same container.
nginx:1.30.2-alpinecertbotopensslapache2-utilswgetcurldocker pull crypticani/nginx:1.30
services:
nginx:
image: crypticani/nginx:1.30
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
CERTBOT_EMAIL: [email protected]
CERTBOT_WEBROOT: /var/www/certbot
volumes:
- ./conf.d:/etc/nginx/conf.d
- ./letsencrypt:/etc/letsencrypt
- ./logs:/var/log/nginx
Create conf.d/default.conf.
This file handles:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location = /healthz {
access_log off;
default_type text/plain;
return 200 "ok\n";
}
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
default_type text/plain;
try_files $uri =404;
}
location / {
return 444;
}
}
Start Nginx with only this default HTTP config first:
docker compose up -d
Check container status:
docker ps
The image includes a helper script:
generate-cert.sh
Generate a certificate for one subdomain:
docker exec -it nginx generate-cert.sh grafana.example.com
Content type
Image
Digest
sha256:2909486a9…
Size
47.5 MB
Last updated
5 months ago
docker pull crypticani/nginx:1.30