dtaddis commited on
Commit
de3bdc2
·
1 Parent(s): c6aabe7

Make sure directory is created in Docker

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -3
Dockerfile CHANGED
@@ -1,7 +1,16 @@
1
  FROM nginx:alpine
2
- # HF Spaces run as a non-root user, so we need to grant permissions
3
- RUN chmod -R 777 /var/cache/nginx /var/run /var/log/nginx /usr/share/nginx/html /etc/nginx/conf.d
4
- COPY nginx.conf /etc/nginx/conf.d/default.conf
 
 
5
  COPY . /usr/share/nginx/html
 
 
 
 
 
 
 
6
  EXPOSE 7860
7
  CMD ["nginx", "-g", "daemon off;"]
 
1
  FROM nginx:alpine
2
+
3
+ # Create the directory and set permissions first
4
+ RUN mkdir -p /usr/share/nginx/html && chmod -R 777 /usr/share/nginx/html
5
+
6
+ # Now copy your files
7
  COPY . /usr/share/nginx/html
8
+
9
+ # Copy the config
10
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
11
+
12
+ # Fix permissions for Nginx internal folders (HF requirement)
13
+ RUN chmod -R 777 /var/cache/nginx /var/run /var/log/nginx /etc/nginx/conf.d
14
+
15
  EXPOSE 7860
16
  CMD ["nginx", "-g", "daemon off;"]