| 1 | FROM 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. |
| 9 | USER root |
| 10 | RUN 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 |
| 13 | USER nginx |
| 14 | |
| 15 | COPY index.html /usr/share/nginx/html/index.html |
| 16 | EXPOSE 8080 |