Sign inSign up

sighne/nginx

By sighne

Updated over 9 years ago

Nginx reverse proxy image with Certbot (LetsEncrypt) support

Image
0

250

sighne/nginx repository overview

Nginx reverse proxy image with Certbot (LetsEncrypt) support

Container creation

From CLI

docker run -d --tty --name nginx -p 80:80 -p 443:443 -v /tmp/nginx:/etc/nginx/conf.d -v /etc/docker-gen/templates sighne/nginx docker run -d --name nginx-gen --volumes-from nginx -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/docker-gen -notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf

From Compose
nginx:
    build: ./Dockerfile/Nginx
    image: sighne/nginx
    container_name: nginx
    ports:
        - "80:80"
    volumes:
        - /tmp/nginx:/etc/nginx/conf.d
        - /etc/docker-gen/templates
    tty: true

nginx-gen:
    image: jwilder/docker-gen
    container_name: nginx-gen
    volumes_from:
        - nginx
    volumes:
        - /var/run/docker.sock:/tmp/docker.sock:ro
    command: "-notify-sighup nginx -watch -only-exposed /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf"

SSL configuration

docker exec -it nginx certbot certonly --standalone

NB: Generate domain certificate before creating the corresponding container

Credits

Certbot: https://certbot.eff.org

Nginx-proxy: https://github.com/jwilder/nginx-proxy

Tag summary

Content type

Image

Digest

Size

124.1 MB

Last updated

over 9 years ago

docker pull sighne/nginx