We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe1fd38 commit 393a223Copy full SHA for 393a223
.docker/nginx.conf
@@ -38,8 +38,8 @@ http {
38
resolver 127.0.0.11 ipv6=off;
39
40
server {
41
- listen 80;
42
- listen [::]:80;
+ listen ${NGINX_PORT};
+ listen [::]:${NGINX_PORT};
43
server_name localhost;
44
45
location / {
.docker/scripts/90-envsubst-on-nginx-conf.sh
@@ -0,0 +1,9 @@
1
+#!/usr/bin/env sh
2
+
3
+set -ex
4
5
+config_file="/etc/nginx/nginx.conf"
6
7
+tmpfile=$(mktemp)
8
+envsubst '${NGINX_PORT}' < "$config_file" > "$tmpfile"
9
+mv "$tmpfile" "$config_file"
Dockerfile
@@ -1,6 +1,8 @@
FROM nginxinc/nginx-unprivileged:alpine-slim AS prod
-EXPOSE 8080
+ENV NGINX_PORT=80
+EXPOSE 80
COPY --chmod=755 .docker/scripts/ /docker-entrypoint.d/
COPY --chown=nginx:root .docker/nginx.conf /etc/nginx/
0 commit comments