Giter Club home page Giter Club logo

docker-alpine-nginx's Introduction

Alpine Nginx Image

https://www.augustash.com

This base container is not currently aimed at public consumption. It exists as a starting point for August Ash containers.

Versions

See VERSIONS.md for image contents.

Usage

Launch a single-use Nginx container serving the current directory:

docker run --rm \
    -p 8080:80 \
    -p 8443:443 \
    -v $(pwd):/src \
    augustash/alpine-nginx

Accessing Served Content

Ports 80 and 443 are exposed via this image. To access the Nginx web server from outside the container, you'll need to map ports on your host to the container.

This container works best in combination with our PHP-FPM container so that dynamic content can be served.

Note: If your PHP-FPM container was started with docker-compose and has a network, you'll need to link it differently:

docker run --rm \
    -p 8080:80 \
    -p 8443:443 \
    --link <PHP CONTAINER>:phpfpm \
    --net <NETWORK NAME> \
    -v $(pwd)/site.template:/config/nginx/hosts.d/site.conf \
    -v $(pwd):/src \
    augustash/alpine-nginx

HTML Content

The content served by this container lives in the /src directory. You can customize what will be served by mounting a host directory to /src.

Nginx Configuration and Host Configuration

The image is prepared in a way to make it relatively easy to customize both Nginx itself and the hosts.

Custom Nginx configuration should be added to /etc/nginx/conf.d/ and custom host files should be added to /etc/nginx/hosts.d/.

The structure of the directory should look like:

/config/nginx
├── conf.d
│   ├── 10-mime.conf
│   ├── 20-logs.conf
│   ├── 30-gzip.conf
│   ├── 40-general.conf
│   └── 50-ssl.conf
├── hosts.d
│   └── default.conf
└── nginx.conf

User/Group Identifiers

To help avoid nasty permissions errors, the container allows you to specify your own PUID and PGID. This can be a user you've created or even root (not recommended).

Environment Variables

The following variables can be set and will change how the container behaves. You can use the -e flag, an environment file, or your Docker Compose file to set your preferred values. The default values are shown:

  • PUID=501
  • PGID=1000
  • NGINX_SSL_SUBJECT=/C=US/ST=MN/L=Minneapolis/O=August Ash/OU=Local Server/CN=*
  • NGINX_DH_SIZE=2048

Inspiration

docker-alpine-nginx's People

Contributors

petemcw avatar

Watchers

 avatar  avatar

Forkers

randy-dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.