Spaces:
Paused
Paused
harishaseebat92
commited on
Commit
·
ea45eb7
1
Parent(s):
2b5e16f
resolve the Nginx permission issue that Hugging Face reported
Browse files- Dockerfile +5 -0
- docker/nginx.conf +5 -0
Dockerfile
CHANGED
|
@@ -49,6 +49,11 @@ RUN python3 -m pip install --upgrade pip setuptools wheel \
|
|
| 49 |
COPY --chown=user:user . .
|
| 50 |
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
# 7. Switch to the non-root user
|
| 53 |
USER user
|
| 54 |
|
|
|
|
| 49 |
COPY --chown=user:user . .
|
| 50 |
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
| 51 |
|
| 52 |
+
# Prepare writable directories for nginx (running as non-root later)
|
| 53 |
+
RUN mkdir -p /tmp/nginx/body /tmp/nginx/proxy /tmp/nginx/fastcgi /tmp/nginx/uwsgi /tmp/nginx/scgi \
|
| 54 |
+
&& touch /tmp/nginx.access.log /tmp/nginx.error.log \
|
| 55 |
+
&& chown -R user:user /tmp/nginx /tmp/nginx.access.log /tmp/nginx.error.log
|
| 56 |
+
|
| 57 |
# 7. Switch to the non-root user
|
| 58 |
USER user
|
| 59 |
|
docker/nginx.conf
CHANGED
|
@@ -8,6 +8,11 @@ events {
|
|
| 8 |
|
| 9 |
http {
|
| 10 |
access_log /tmp/nginx.access.log;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
include /etc/nginx/mime.types;
|
| 12 |
default_type application/octet-stream;
|
| 13 |
sendfile on;
|
|
|
|
| 8 |
|
| 9 |
http {
|
| 10 |
access_log /tmp/nginx.access.log;
|
| 11 |
+
client_body_temp_path /tmp/nginx/body;
|
| 12 |
+
proxy_temp_path /tmp/nginx/proxy;
|
| 13 |
+
fastcgi_temp_path /tmp/nginx/fastcgi;
|
| 14 |
+
uwsgi_temp_path /tmp/nginx/uwsgi;
|
| 15 |
+
scgi_temp_path /tmp/nginx/scgi;
|
| 16 |
include /etc/nginx/mime.types;
|
| 17 |
default_type application/octet-stream;
|
| 18 |
sendfile on;
|