Fix some kinda permission error ig
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -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;"]
|
||||
|
||||
Reference in New Issue
Block a user