honey234 commited on
Commit
0aa5c09
·
1 Parent(s): d0e3dc8
Files changed (1) hide show
  1. Dockerfile +45 -5
Dockerfile CHANGED
@@ -1,12 +1,52 @@
1
  # Use an Nginx base image
2
  FROM nginx:alpine
3
 
 
 
 
 
 
 
 
 
 
4
  # Copy Flutter web build files to Nginx web root
5
  COPY web /usr/share/nginx/html
6
 
7
- # Set permissions for the nginx user
8
- RUN chown -R nginx:nginx /usr/share/nginx/html && \
9
- chmod -R 755 /usr/share/nginx/html
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- # Copy a custom Nginx configuration if needed
12
- # COPY nginx.conf /etc/nginx/conf.d/default.conf
 
1
  # Use an Nginx base image
2
  FROM nginx:alpine
3
 
4
+ # Create required nginx directories and set permissions before copying files
5
+ RUN mkdir -p /tmp/nginx/cache && \
6
+ mkdir -p /tmp/nginx/run && \
7
+ mkdir -p /tmp/nginx/client_temp && \
8
+ mkdir -p /tmp/nginx/proxy_temp && \
9
+ mkdir -p /tmp/nginx/fastcgi_temp && \
10
+ mkdir -p /tmp/nginx/uwsgi_temp && \
11
+ mkdir -p /tmp/nginx/scgi_temp
12
+
13
  # Copy Flutter web build files to Nginx web root
14
  COPY web /usr/share/nginx/html
15
 
16
+ # Copy custom nginx configuration
17
+ # RUN echo $'daemon off;\n\
18
+ # pid /tmp/nginx/nginx.pid;\n\
19
+ # worker_processes 1;\n\
20
+ # error_log /dev/stdout info;\n\
21
+ # events {\n\
22
+ # worker_connections 1024;\n\
23
+ # }\n\
24
+ # http {\n\
25
+ # client_body_temp_path /tmp/nginx/client_temp;\n\
26
+ # proxy_temp_path /tmp/nginx/proxy_temp;\n\
27
+ # fastcgi_temp_path /tmp/nginx/fastcgi_temp;\n\
28
+ # uwsgi_temp_path /tmp/nginx/uwsgi_temp;\n\
29
+ # scgi_temp_path /tmp/nginx/scgi_temp;\n\
30
+ # include /etc/nginx/mime.types;\n\
31
+ # default_type application/octet-stream;\n\
32
+ # access_log /dev/stdout;\n\
33
+ # server {\n\
34
+ # listen 7860;\n\
35
+ # server_name localhost;\n\
36
+ # location / {\n\
37
+ # root /usr/share/nginx/html;\n\
38
+ # index index.html index.htm;\n\
39
+ # try_files $uri $uri/ /index.html;\n\
40
+ # }\n\
41
+ # }\n\
42
+ # }\n' > /etc/nginx/nginx.conf
43
+
44
+ # Set appropriate permissions
45
+ RUN chmod -R 777 /tmp/nginx && \
46
+ chmod -R 777 /usr/share/nginx/html
47
+
48
+ # Expose port 7860 (Hugging Face's default port)
49
+ EXPOSE 7860
50
 
51
+ # Start Nginx
52
+ CMD ["nginx", "-c", "/etc/nginx/nginx.conf"]