Fix some kinda permission error ig

This commit is contained in:
2026-01-27 14:07:44 +01:00
parent 07572f8e6c
commit 4167409ccf

View File

@@ -6,6 +6,16 @@ COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
RUN mkdir -p /usr/share/nginx/html /etc/nginx/data/cache /etc/nginx/data/temp
COPY index.html /usr/share/nginx/html/index.html
# When volume is mounted at /etc/nginx/data, ensure cache/temp exist and are writable (fix rename Permission denied)
RUN echo '#!/bin/sh' > /docker-entrypoint.sh \
&& echo 'set -e' >> /docker-entrypoint.sh \
&& echo 'mkdir -p /etc/nginx/data/cache /etc/nginx/data/temp' >> /docker-entrypoint.sh \
&& echo 'chown -R nobody:nobody /etc/nginx/data 2>/dev/null || true' >> /docker-entrypoint.sh \
&& echo 'chmod -R 755 /etc/nginx/data' >> /docker-entrypoint.sh \
&& echo 'exec "$@"' >> /docker-entrypoint.sh \
&& chmod +x /docker-entrypoint.sh
EXPOSE 3000
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]