You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provides base OS, patches and stable nginx for quick and easy spinup.
6
6
7
-
- Ubuntu used by default
8
-
- Alpine builds available tagged as `-alpine`
9
-
- Centos builds available tagged as `-centos`
7
+
- Ubuntu 22.04 used by default
8
+
- Alpine builds available tagged as `-alpine`**DEPRECATED**
9
+
- Centos builds available tagged as `-centos`**DEPRECATED**
10
10
11
-
12
-
[S6](https://github.com/just-containers/s6-overlay) process supervisor is used for `only` for zombie reaping (as PID 1), boot coordination, and termination signal translation
11
+
[S6](https://github.com/just-containers/s6-overlay) process supervisor is used
12
+
for `only` for zombie reaping (as PID 1), boot coordination, and termination
13
+
signal translation
13
14
14
15
[Goss](https://github.com/aelsabbahy/goss) is used for build-time testing.
15
16
16
-
See parent(s) [docker-base](https://github.com/behance/docker-base) for additional configuration
17
-
18
-
19
-
### Expectations
20
-
21
-
- Applications must copy their html/app into the `/var/www/html` folder
22
-
- Any new script/file that needs to be added must be given proper permissions/ownership to the non root user through `container/root/scripts/set_permissions.sh`. This is to ensure that the image can be run under a non root user.
23
-
- NOTE: Nginx is exposed and bound to an unprivileged port, `8080`
24
-
25
-
26
-
### Container Security
27
-
28
-
See parent [configuration](https://github.com/behance/docker-base#security)
29
-
30
-
31
-
### HTTPS usage
32
-
33
-
To enable this container to serve HTTPS over its primary exposed port:
34
-
-`SERVER_ENABLE_HTTPS` environment variable must be `true`
35
-
- Certificates must be present in `/etc/nginx/certs` under the following names:
36
-
-`ca.crt`
37
-
-`ca.key`
38
-
- Additionally, they must be marked read-only (0600)
39
-
40
-
#### Local development usage
41
-
42
-
To generate a self-signed certificate (won't work in most browsers):
SERVER_MAX_BODY_SIZE | SERVER_MAX_BODY_SIZE=4M | Allows the downstream application to specify a non-default `client_max_body_size` configuration for the `server`-level directive in `/etc/nginx/sites-available/default`
70
-
SERVER_INDEX | SERVER_INDEX index.html index.html index.php | Changes the default pages to hit for folder and web roots
71
-
SERVER_APP_NAME | SERVER_APP_NAME='view' | Gets appended to the default logging format
72
-
SERVER_GZIP_OPTIONS | SERVER_GZIP_OPTIONS=1 | Allows default set of static content to be served gzipped
73
-
SERVER_SENDFILE | SERVER_SENDFILE=off | Allows runtime to specify value of nginx's `sendfile` (default, on)
74
-
SERVER_ENABLE_HTTPS | SERVER_ENABLE_HTTPS=true | Enable encrypted transmission using certificates
SERVER_LOG_MINIMAL | SERVER_LOG_MINIMAL=1 | Minimize the logging format, appropriate for development environments
82
-
S6_KILL_FINISH_MAXTIME | S6_KILL_FINISH_MAXTIME=55000 | The maximum time (in ms) a script in /etc/cont-finish.d could take before sending a KILL signal to it. Take into account that this parameter will be used per each script execution, it's not a max time for the whole set of scripts. This value has a max of 65535 on Alpine variants.
83
-
S6_KILL_GRACETIME | S6_KILL_GRACETIME=500 | Wait time (in ms) for S6 finish scripts before sending kill signal
84
-
85
-
86
-
### Startup/Runtime Modification
87
-
88
-
- Environment variables are used to drive nginx configuration at runtime
89
-
- See [here](https://github.com/behance/docker-base#startupruntime-modification) for more advanced options
90
-
91
-
### Shutdown Behavior
92
-
93
-
Graceful shutdown is handled as part of the [existing](https://github.com/behance/docker-base#shutdown-behavior) S6 termination process, using a `/etc/cont-finish.d` script.
94
-
Nginx will attempt to drain active workers, while rejecting new connections. The drain timeout is controlled by `S6_KILL_FINISH_MAXTIME`, which corresponds to the length of time the supervisor will wait for the script to run during shutdown. This value defaults to 55s, which deliberately `less` than an downstream load balancers default max connection length (60s). Each upstream's timeout must be less than the downstream, for sanity and lack of timing precision.
95
-
96
-
### Long-running processes (workers + crons)
97
-
98
-
- See parent [configuration](https://github.com/behance/docker-base#long-running-processes-workers--crons) on reusing container for other purposes.
99
-
100
-
101
-
### Container Organization
102
-
103
-
Besides the instructions contained in the Dockerfile, the majority of this
104
-
container's use is in configuration and process. The `./container/root` repo directory is overlayed into a container during build. Adding additional files
105
-
to the folders in there will be present in the final image.
106
-
107
-
Nginx is currently set up as an S6 service in `/etc/services-available/nginx`, during default environment conditions, it will symlink itself to be supervised under `/etc/services.d/nginx`. When running under worker entrypoint (`worker.sh`), it will not be S6's `service.d` folder to be supervised.
108
-
109
-
110
-
### Release Management
111
-
112
-
Github actions provide the machinery for testing (ci.yaml) and producing tags distributed through Docker Hub (publish.yaml). Testing will confirm that `nginx` is able to serve content in various configurations, but also that it can terminate TLS with self-signed certificates. Once a tested and approved PR is merged, simply cutting a new semantically-versioned tag will generate the following matrix of tagged builds:
113
-
-`[major].[minor].[patch](?-variant)`
114
-
-`[major].[minor](?-variant)`
115
-
-`[major](?-variant)`
116
-
Platform support is available for architectures:
117
-
-`linux/arm64`
118
-
-`linux/amd64`
17
+
See parent(s) [docker-base](https://github.com/behance/docker-base) for
18
+
additional configuration
119
19
120
-
To add new variant based on a new Dockerfile, add an entry to `matrix.props` within `./github/workflows` YAML files.
20
+
# Expectations
121
21
122
-
### Github Actions: Simulation
22
+
NOTE: Nginx is exposed and bound to an unprivileged port, `8080`
123
23
124
-
docker-nginx uses Github Actions for CI/CD. Simulated workflows can be achieved locally with `act`. All commands must be executes from repository root.
24
+
* Applications must copy their html/app into the `/var/www/html` folder
* Any new script/file that needs to be added must be given proper permissions /
27
+
ownership to the non root user through `container/root/scripts/set_permissions.sh`.
28
+
This is to ensure that the image can be run under a non root user.
129
29
130
-
Pull request simulation: executes successfully, but only on ARM devices (ex. Apple M1). ARM emulation through QEMU on X64 machines does not implement the full kernel functionality required by nginx at this time.
131
-
-`act pull_request`
30
+
# Quick Start
132
31
133
-
Publish simulation: executes, but fails (intentionally) without credentials
0 commit comments