File size: 609 Bytes
b61cc42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM nginx:alpine

# Copy all files to the NGINX html directory
COPY . /usr/share/nginx/html/

# Set proper permissions
RUN chmod -R 755 /usr/share/nginx/html

# Create default.conf for nginx to listen on port 7860 (Hugging Face's default port)
RUN echo 'server { \
    listen 7860; \
    server_name _; \
    location / { \
        root /usr/share/nginx/html; \
        index index.html; \
        try_files $uri $uri/ /index.html; \
    } \
}' > /etc/nginx/conf.d/default.conf

# Expose port 7860 for Hugging Face Spaces
EXPOSE 7860

# Start NGINX
CMD ["nginx", "-g", "daemon off;"]