1FROM nginxinc/nginx-unprivileged:alpine
2
3# The stock nginx image symlinks /var/log/nginx/{access,error}.log to
4# /dev/stdout and /dev/stderr. Inside Cloudflare's container sandbox those
5# device paths cannot be opened (open() fails with ENXIO, errno 6), so nginx
6# aborts at startup with `[emerg] could not open error log file` and the
7# container crash-loops — the port is never bound and getTcpPort() hangs.
8# Replace the symlinks with real, nginx-writable files so the master can boot.
9USER root
10RUN rm -f /var/log/nginx/access.log /var/log/nginx/error.log \
11 && touch /var/log/nginx/access.log /var/log/nginx/error.log \
12 && chown nginx:nginx /var/log/nginx/access.log /var/log/nginx/error.log
13USER nginx
14
15COPY index.html /usr/share/nginx/html/index.html
16EXPOSE 8080