docker-nginx

clion/nginx

Nginx is an webserver with php support and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev.

This is a custom image built with Alpine linux, nginx and logrotate. All softwares are keeped latest version. The config files reside in /config for easy user customization.This image will auto check and update when there is new version of nginx exist.

Application Setup

Modules installed

Usage

To help you get started creating a container from this image you can use the docker cli.

Docker cli

docker run -d \
  --name='Nginx' \
  --net='bridge' \
  --ip='192.168.*.*' #optional \
  -e TZ="Asia/Shanghai"
  -e 'PUID'='1000'
  -e 'PGID'='1000'
  -e 'UMASK'='022'
  -p 80:80 #optional \
  -p 443:443 #optional \
  -v '/path/to/nginx/config':'/config' \
  -v /etc/localtime:/etc/localtime:ro \
  --restart unless-stopped \
  registry.cn-chengdu.aliyuncs.com/clion/nginx

Docker-compose

services:
  nginx:
    image: registry.cn-chengdu.aliyuncs.com/clion/nginx
    container_name: nginx
    environment:
      - PUID=99
      - PGID=100
      - UMASK=022
    volumes:
      - /path/to/nginx/config:/config
      - /etc/localtime:/etc/localtime:ro
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped

Parameters

Umask for running applications

For all of my images I provide the ability to override the default umask settings for services started within the containers using the optional -e UMASK=022 setting. Keep in mind umask is not chmod it subtracts from permissions based on it’s value it does not add.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.