Skip to content

Commit e7d31d3

Browse files
committed
static-nginx
file path fix and change entrypoint/command
1 parent f2afcb9 commit e7d31d3

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

static-nginx.unprivileged-nginxuser.Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ENV OUTPUT_DIR=/nginx
1313

1414
LABEL org.opencontainers.image.title="Static NGINX"\
1515
org.opencontainers.image.revision="${VCS_REF}" \
16-
org.opencontainers.image.description="Static NGINX ${NGINX_VERSION} build with pcre2-${PCRE2_VERSION}, zlib-${ZLIB_VERSION} and openssl-${OPENSSL_VERSION}" \
16+
org.opencontainers.image.description="Static NGINX${NGINX_VERSION:+ ${NGINX_VERSION}} (unprivileged/nginxuser) build with pcre2${PCRE2_VERSION:+-${PCRE2_VERSION}}, zlib${ZLIB_VERSION:+-${ZLIB_VERSION}} and openssl${OPENSSL_VERSION:+-${OPENSSL_VERSION}}" \
1717
org.opencontainers.image.source="https://github.com/Tob1as/docker-tools/"
1818

1919
SHELL ["/bin/ash", "-euxo", "pipefail", "-c"]
@@ -33,8 +33,7 @@ RUN echo ">> Install build packages ..." && \
3333
autoconf \
3434
automake \
3535
\
36-
geoip-dev \
37-
geoip-static \
36+
geoip-dev geoip-static \
3837
&& \
3938
mkdir -p ${OUTPUT_DIR}
4039

@@ -123,7 +122,7 @@ RUN echo ">> Download and BUILD: nginx-${NGINX_VERSION} ..." && \
123122
cd ..
124123

125124
RUN echo ">> do something after builds ..." && \
126-
mkdir -p ${OUTPUT_DIR}/etc/nginx/ ${OUTPUT_DIR}/var/cache/nginx/ ${OUTPUT_DIR}/usr/sbin ${OUTPUT_DIR}/usr/lib/nginx/modules ${OUTPUT_DIR}/var/run ${OUTPUT_DIR}/var/log/nginx ${OUTPUT_DIR}/usr/share/nginx/html && \
125+
mkdir -p ${OUTPUT_DIR}/etc/nginx/ ${OUTPUT_DIR}/var/cache/nginx/ ${OUTPUT_DIR}/usr/sbin ${OUTPUT_DIR}/usr/lib/nginx/modules ${OUTPUT_DIR}/var/run ${OUTPUT_DIR}/var/log/nginx ${OUTPUT_DIR}/usr/share/nginx/html ${OUTPUT_DIR}/etc/ssl/ && \
127126
cp nginx-${NGINX_VERSION}/objs/nginx ${OUTPUT_DIR}/usr/sbin/ && \
128127
cp -r nginx-${NGINX_VERSION}/conf/. ${OUTPUT_DIR}/etc/nginx/ && \
129128
#cp -r nginx-${NGINX_VERSION}/html/. ${OUTPUT_DIR}/usr/share/nginx/html && \
@@ -152,7 +151,7 @@ events {
152151

153152

154153
http {
155-
include mime.types;
154+
include /etc/nginx/mime.types;
156155
default_type application/octet-stream;
157156

158157
log_format main '\$remote_addr - \$remote_user [\$time_local] "\$request" '
@@ -169,6 +168,8 @@ http {
169168

170169
#gzip on;
171170

171+
#server_tokens off;
172+
172173
include /etc/nginx/conf.d/*.conf;
173174
}
174175

@@ -196,7 +197,7 @@ server {
196197
#
197198
error_page 500 502 503 504 /50x.html;
198199
location = /50x.html {
199-
root html;
200+
root /usr/share/nginx/html;
200201
}
201202

202203
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
@@ -244,8 +245,8 @@ server {
244245
# listen [::]:443 ssl;
245246
# server_name localhost;
246247
#
247-
# ssl_certificate /ssl/ssl.crt;
248-
# ssl_certificate_key /ssl/ssl.key;
248+
# ssl_certificate /etc/ssl/ssl.crt;
249+
# ssl_certificate_key /etc/ssl/ssl.key;
249250
#
250251
# ssl_session_cache shared:SSL:1m;
251252
# ssl_session_timeout 5m;
@@ -268,7 +269,7 @@ server {
268269
# #
269270
# error_page 500 502 503 504 /50x.html;
270271
# location = /50x.html {
271-
# root html;
272+
# root /usr/share/nginx/html;
272273
# }
273274
#
274275
# # proxy the PHP scripts to Apache listening on 127.0.0.1:80
@@ -390,5 +391,4 @@ STOPSIGNAL SIGQUIT
390391
EXPOSE 8080
391392
USER 101
392393

393-
ENTRYPOINT ["nginx"]
394-
CMD ["-g", "daemon off;"]
394+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)