monstrenyatko / docker-nginx

Recipe to build the NGINX server Docker image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NGINX server Docker image

About

NGINX web/reverse-proxy server in the Docker container.

Upstream Links

Quick Start

Container is already configured for automatic restart (See docker-compose.yml).

  • Configure environment:

    • NGINX_UID: [OPTIONAL] UID to be used to run process instead of default:

        export NGINX_UID="1000"
    • NGINX_GID: [OPTIONAL] GID to be used to run process instead of default:

        export NGINX_GID="1000"
    • DOCKER_REGISTRY: [OPTIONAL] registry prefix to pull image from a custom Docker registry:

        export DOCKER_REGISTRY="my_registry_hostname:5000/"
  • Pull prebuilt Docker image:

      docker-compose pull
  • Start prebuilt image:

      docker-compose up -d
  • Verify default configuration:

    Open http://localhost:8000 in web browser.

  • Stop/Restart:

      docker-compose stop
      docker-compose start
  • Configuration:

    • Create the conf.d directory with *.conf file or files
    • Add to docker-compose.yml the volumes section:
      nginx:
        ...
        volumes:
          - ./conf.d:/etc/nginx/conf.d:ro
    • [OPTIONAL] Override the main configuration file:
      nginx:
        ...
        volumes:
          - ./nginx.conf:/etc/nginx/nginx.conf:ro

Build own image

  • default target platform:

      cd <path to sources>
      DOCKER_BUILDKIT=1 docker build --tag <tag name> .
  • arm/v6 target platform:

      cd <path to sources>
      DOCKER_BUILDKIT=1 docker build --platform=linux/arm/v6 --tag <tag name> .

About

Recipe to build the NGINX server Docker image

License:MIT License


Languages

Language:Dockerfile 52.6%Language:Shell 47.4%