188a026e226501da4da8269a94caa6915d68cfda
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
Languages
Dockerfile
100%