Files
11note-docker-nginx/README.md
2018-12-11 08:18:08 +01:00

1.2 KiB
Raw Blame History

docker-nginx

Dockerfile to create and run your own nginx process inside an alpine docker container.

docker volumes

/nginx/etc

Contains: vhost for nginx. Must end in *.conf (set in /etc/nginx/nginx.conf)

/nginx/www

Contains: webroot for vhost etc

/nginx/ssl

Contains: SSL certificates, ment as read only for web workes from a central ssl store

docker build

docker build -t YOURNAME/YOURCONTAINER:YOURTAG .

docker run

docker run --name nginx \
    -u 1000:1000 \
   -v volume-etc:/nginx/etc \
   -v volume-www:/nginx/www \
   -v volume-ssl:/nginx/ssl:ro \
   -d 11notes/nginx:latest

difference between official container

Additional plugins:

    module_headers_more

Nginx configuration and uid/gid:

    uid:gid both set to static 1000:1000
    all data moved to /nginx

build with

tips

  • Don't bind to ports < 1024 (requires root)
  • alpine-docker-netshare - Examples to store persistent storage on NFS/CIFS/etc