forked from nginxinc/nginx-s3-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.oss
35 lines (29 loc) · 1.32 KB
/
Dockerfile.oss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM nginx:1.23.3
ENV NGINX_VERSION "1.23.3"
ENV NJS_VERSION 0.7.10
ENV PROXY_CACHE_VALID_OK "1h"
ENV PROXY_CACHE_VALID_NOTFOUND "1m"
ENV PROXY_CACHE_VALID_FORBIDDEN "30s"
ENV CORS_ENABLED 0
# We modify the nginx base image by:
# 1. Adding configuration files needed for proxying private S3 buckets
# 2. Adding a directory for proxied objects to be stored
# 3. Replacing the entrypoint script with a modified version that explicitly
# sets resolvers.
# 4. Explicitly install the version of njs coded in the environment variable
# above.
COPY common/etc /etc
COPY common/docker-entrypoint.sh /docker-entrypoint.sh
COPY common/docker-entrypoint.d /docker-entrypoint.d/
COPY oss/etc /etc
RUN set -eux \
export DEBIAN_FRONTEND=noninteractive; \
mkdir -p /var/cache/nginx/s3_proxy; \
chown nginx:nginx /var/cache/nginx/s3_proxy; \
chmod -R -v +x /docker-entrypoint.sh /docker-entrypoint.d/*.sh; \
echo "deb https://nginx.org/packages/mainline/debian/ $(echo $PKG_RELEASE | cut -f2 -d~) nginx" >> /etc/apt/sources.list.d/nginx.list; \
apt-get update; \
apt-get install --no-install-recommends --no-install-suggests --yes \
curl nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-${PKG_RELEASE}; \
apt-get remove --purge --auto-remove --yes; \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list