I have a container include nginx.
I store my container on ECR, and i deploy my container on ECS.
When the option readonlyRootFilesystem is false, my instance with nginx is working.
If the option readonlyRootFilesystem is true,
i have error below
nginx: [alert] could not open error log file: open() "/var/lib/nginx/logs/error.log" failed (30: Read-only file system) |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 2024/05/06 22:18:13 [warn] 1#1: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:3 |
| 2024/05/06 22:18:13 [emerg] 1#1: mkdir() "/var/lib/nginx/tmp/client_body" failed (30: Read-only file system)
my docker file is like
...
RUN chown -R nginx:nginx /app && chmod -R 755 /app &&
chown -R nginx:nginx /var/lib/nginx &&
chown -R nginx:nginx /var/log/nginx &&
chown -R nginx:nginx /etc/nginx
RUN touch /var/run/nginx.pid &&
chown -R nginx:nginx /var/run/nginx.pid
USER nginx
EXPOSE 8090
CMD ["nginx", "-g", "daemon off;"]
Someone have an idea to resolve this problem ?