|
1 | | -FROM public.ecr.aws/nginx/nginx:1.23 |
2 | | -RUN apt-get update \ |
3 | | - && apt-get install -y --no-install-recommends ruby \ |
4 | | - && rm -rf /var/lib/apt/lists/* |
5 | | -COPY docker-entrypoint.d.sh /docker-entrypoint.d/rko-router.sh |
6 | | -COPY config/nginx.conf.erb /etc/nginx/nginx.conf.erb |
7 | | -COPY config/force_https.conf /etc/nginx/force_https.conf |
8 | | -RUN /docker-entrypoint.d/rko-router.sh |
9 | | -RUN nginx -c /etc/nginx/nginx.conf |
| 1 | +FROM public.ecr.aws/nginx/nginx:1.29 |
| 2 | + |
| 3 | +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ |
| 4 | + --mount=type=cache,target=/var/lib/apt,sharing=locked \ |
| 5 | + apt-get update \ |
| 6 | + && apt-get install -y --no-install-recommends ruby |
| 7 | + |
| 8 | +COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.1 /lambda-adapter /opt/extensions/lambda-adapter |
| 9 | + |
| 10 | +# Replace /etc/nginx with a temporary directory for Lambda, where /etc/nginx is read-only |
| 11 | +# /run is for /run/nginx.pid |
| 12 | +RUN mv /etc/nginx /etc/nginx.base \ |
| 13 | + && rm -rf /run && ln -s /tmp/run /run \ |
| 14 | + && ln -s /tmp/run/etc-nginx /etc/nginx \ |
| 15 | + && rm -rf /etc/nginx.base/conf.d/default.conf \ |
| 16 | + && rm -v /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh # We don't use conf.d/default.conf |
| 17 | +
|
| 18 | +COPY config/nginx.conf.erb /etc/nginx.base/nginx.conf.erb |
| 19 | +COPY config/github_pages.conf /etc/nginx.base/github_pages.conf |
| 20 | +COPY config/force_https.conf /etc/nginx.base/force_https.conf |
| 21 | +
|
| 22 | +COPY docker/entrypoint.d/00-rk-tmp-etc-nginx.sh /docker-entrypoint.d/ |
| 23 | +COPY docker/entrypoint.d/90-rko-router.sh /docker-entrypoint.d/ |
| 24 | +
|
| 25 | +ENV AWS_LWA_PORT 8080 |
| 26 | +ENV AWS_LWA_READINESS_CHECK_PATH /healthz |
| 27 | +ENV AWS_LWA_PASS_THROUGH_PATH /_events |
| 28 | +
|
10 | 29 | ENV PRIMARY_HOST rko-router.rubykaigi.org |
| 30 | +
|
| 31 | +RUN --mount=type=tmpfs,target=/tmp/run \ |
| 32 | + /docker-entrypoint.d/00-rk-tmp-etc-nginx.sh \ |
| 33 | + && /docker-entrypoint.d/90-rko-router.sh \ |
| 34 | + && nginx -c /etc/nginx/nginx.conf |
| 35 | +
|
11 | 36 | EXPOSE 8080 |
0 commit comments