https://github.com/jitesoft/docker-nginx
Docker image containing NginX on Alpine Linux.
https://github.com/jitesoft/docker-nginx
alpine-linux docker dockerfile hacktoberfest jitesoft nginx
Last synced: 6 months ago
JSON representation
Docker image containing NginX on Alpine Linux.
- Host: GitHub
- URL: https://github.com/jitesoft/docker-nginx
- Owner: jitesoft
- License: mit
- Created: 2019-07-21T16:35:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-06-30T09:43:14.000Z (7 months ago)
- Last Synced: 2025-06-30T10:38:00.009Z (7 months ago)
- Topics: alpine-linux, docker, dockerfile, hacktoberfest, jitesoft, nginx
- Language: Dockerfile
- Homepage: https://nginx.org
- Size: 128 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nginx
[](https://cloud.docker.com/u/jitesoft/repository/docker/jitesoft/nginx)
[](https://opencollective.com/jitesoft-open-source)
Nginx running on alpine linux.
### Notice
Due to a currently unresolved issue with the x390s and ppc64 builds, images for those two architectures have been paused.
## Tags
The image is built automatically via CI, using latest alpine as base image.
Images can be found at:
* [Docker hub](https://hub.docker.com/r/jitesoft/nginx): `jitesoft/nginx`
* [GitLab](https://gitlab.com/jitesoft/dockerfiles/nginx): `registry.gitlab.com/jitesoft/dockerfiles/nginx`
* [GitHub](https://github.com/orgs/jitesoft/packages/container/package/nginx): `ghcr.io/jitesoft/nginx`
* [Quay](https://quay.io/jitesoft/nginx): `quay.io/jitesoft/nginx`
## Dockerfile
Dockerfile can be found at [GitLab](https://gitlab.com/jitesoft/dockerfiles/nginx) and [GitHub](https://github.com/jitesoft/docker-nginx)
## Usage
Most basic usage is to just run the container, nginx will start and serve the content in the /usr/local/nginx/html directory.
Port `80` is exposed by default.
### www-data user
The www-data user have the same id as the www-data user in the most common alpine images, 82.
Before 2021 07 23, the id was 1000, which created issues with read/write permissions
when used with the jitesoft/php image.
Containers created runs as root (easily changed in production with the appropriate flags),
while the nginx process runs as the www-data user (82) by default.
### Template
To ease the setup process, the startup script will generate a default.conf file in the /etc/nginx/conf.d directory. Any files in said directory will be
loaded into nginx by default.
When the template is generated, the script will run `envsubstr` to replace all template vars with passed environment variables. If you wish to customise the template
you may create a new template and set the `CONF_TEMPLATE` variable to the path of the file and use `${VARIABLE}` placeholders to replace those with the
named env variables passed.
The default template file is located at `/usr/local/default.template` and exposes `LISTEN_PORT`, `SERVER_NAME` and `SERVER_ROOT` env variables and defaults to `80`, `localhost` and `/usr/local/nginx/html`.
It's also possible to change the full initial nginx configuration by replacing the `/etc/nginx/nginx.conf` file, while not recommended (rather create a new file to override in `/etc/nginx/conf.d`).
### Healthcheck
By default, the container will run a health check - via the `healthcheck` shell script - every 30 seconds.
The health check script uses wget to hit a special endpoint (`127.0.0.1:3999/__health`), which is automatically created in the `/etc/nginx/conf.d/000-healthcheck.conf` configuration.
It's possible to turn the healthcheck off by setting `SKIP_HEALTHCHECK=true` as an env variable. The healthcheck will still run, but always return as healthy.
Changing the healthcheck scripts is possible, while not recommended.
## Image labels
This image follows the [Jitesoft image label specification 1.0.0](https://gitlab.com/snippets/1866155).
## Licenses
Files in this repository are released under the MIT license.
Nginx is released under [2-clause BSD-like license](https://nginx.org/LICENSE).
## Sponsors
Jitesoft images are built via GitLab CI on runners hosted by the following wonderful organisations:
_The companies above are not affiliated with Jitesoft or any Jitesoft Projects directly._
---
Sponsoring is vital for the further development and maintaining of open source.
Questions and sponsoring queries can be made by email.
If you wish to sponsor our projects, reach out to the email above or visit any of the following sites:
[Open Collective](https://opencollective.com/jitesoft-open-source)
[GitHub Sponsors](https://github.com/sponsors/jitesoft)
[Patreon](https://www.patreon.com/jitesoft)