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

Add Dockerfile and Nginx.conf

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -0
  2. Nginx.conf +22 -0
Dockerfile ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
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;"]
Nginx.conf ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 7860;
3
+ root /usr/share/nginx/html;
4
+ index index.html;
5
+
6
+ # Tell the browser to natively decompress Brotli files
7
+ location ~ \.wasm\.br$ {
8
+ gzip off;
9
+ add_header Content-Encoding br;
10
+ default_type application/wasm;
11
+ }
12
+ location ~ \.js\.br$ {
13
+ gzip off;
14
+ add_header Content-Encoding br;
15
+ default_type application/javascript;
16
+ }
17
+ location ~ \.data\.br$ {
18
+ gzip off;
19
+ add_header Content-Encoding br;
20
+ default_type application/octet-stream;
21
+ }
22
+ }