devin15 commited on
Commit
b71789b
·
verified ·
1 Parent(s): 8ee3420

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -23
Dockerfile CHANGED
@@ -100,29 +100,55 @@ RUN cd /tmp && \
100
  # 创建nginx配置文件(修改端口为7860)
101
  # 屏蔽警告?: nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
102
  # RUN echo 'user nginx;' > /etc/nginx/nginx.conf && \
103
- RUN echo 'worker_processes auto;' >> /etc/nginx/nginx.conf && \
104
- echo 'error_log /var/log/nginx/error.log;' >> /etc/nginx/nginx.conf && \
105
- echo 'pid /var/run/nginx.pid;' >> /etc/nginx/nginx.conf && \
106
- echo '' >> /etc/nginx/nginx.conf && \
107
- echo 'events {' >> /etc/nginx/nginx.conf && \
108
- echo ' worker_connections 1024;' >> /etc/nginx/nginx.conf && \
109
- echo '}' >> /etc/nginx/nginx.conf && \
110
- echo '' >> /etc/nginx/nginx.conf && \
111
- echo 'http {' >> /etc/nginx/nginx.conf && \
112
- echo ' include /etc/nginx/mime.types;' >> /etc/nginx/nginx.conf && \
113
- echo ' default_type application/octet-stream;' >> /etc/nginx/nginx.conf && \
114
- echo ' sendfile on;' >> /etc/nginx/nginx.conf && \
115
- echo ' keepalive_timeout 65;' >> /etc/nginx/nginx.conf && \
116
- echo '' >> /etc/nginx/nginx.conf && \
117
- echo ' server {' >> /etc/nginx/nginx.conf && \
118
- echo ' listen 7860;' >> /etc/nginx/nginx.conf && \
119
- echo ' server_name localhost;' >> /etc/nginx/nginx.conf && \
120
- echo ' location / {' >> /etc/nginx/nginx.conf && \
121
- echo ' root /usr/share/nginx/html;' >> /etc/nginx/nginx.conf && \
122
- echo ' index index.html index.htm;' >> /etc/nginx/nginx.conf && \
123
- echo ' }' >> /etc/nginx/nginx.conf && \
124
- echo ' }' >> /etc/nginx/nginx.conf && \
125
- echo '}' >> /etc/nginx/nginx.conf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
  # 创建mime.types文件
128
  RUN echo 'types {' > /etc/nginx/mime.types && \
 
100
  # 创建nginx配置文件(修改端口为7860)
101
  # 屏蔽警告?: nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
102
  # RUN echo 'user nginx;' > /etc/nginx/nginx.conf && \
103
+ # RUN echo 'worker_processes auto;' >> /etc/nginx/nginx.conf && \
104
+ # echo 'error_log /var/log/nginx/error.log;' >> /etc/nginx/nginx.conf && \
105
+ # echo 'pid /var/run/nginx.pid;' >> /etc/nginx/nginx.conf && \
106
+ # echo '' >> /etc/nginx/nginx.conf && \
107
+ # echo 'events {' >> /etc/nginx/nginx.conf && \
108
+ # echo ' worker_connections 1024;' >> /etc/nginx/nginx.conf && \
109
+ # echo '}' >> /etc/nginx/nginx.conf && \
110
+ # echo '' >> /etc/nginx/nginx.conf && \
111
+ # echo 'http {' >> /etc/nginx/nginx.conf && \
112
+ # echo ' include /etc/nginx/mime.types;' >> /etc/nginx/nginx.conf && \
113
+ # echo ' default_type application/octet-stream;' >> /etc/nginx/nginx.conf && \
114
+ # echo ' sendfile on;' >> /etc/nginx/nginx.conf && \
115
+ # echo ' keepalive_timeout 65;' >> /etc/nginx/nginx.conf && \
116
+ # echo '' >> /etc/nginx/nginx.conf && \
117
+ # echo ' server {' >> /etc/nginx/nginx.conf && \
118
+ # echo ' listen 7860;' >> /etc/nginx/nginx.conf && \
119
+ # echo ' server_name localhost;' >> /etc/nginx/nginx.conf && \
120
+ # echo ' location / {' >> /etc/nginx/nginx.conf && \
121
+ # echo ' root /usr/share/nginx/html;' >> /etc/nginx/nginx.conf && \
122
+ # echo ' index index.html index.htm;' >> /etc/nginx/nginx.conf && \
123
+ # echo ' }' >> /etc/nginx/nginx.conf && \
124
+ # echo ' }' >> /etc/nginx/nginx.conf && \
125
+ # echo '}' >> /etc/nginx/nginx.conf
126
+ # 创建nginx配置文件(修改端口为7860)
127
+ RUN cat > /etc/nginx/nginx.conf << 'EOF'
128
+ worker_processes auto;
129
+ error_log /var/log/nginx/error.log;
130
+ pid /var/run/nginx.pid;
131
+
132
+ events {
133
+ worker_connections 1024;
134
+ }
135
+
136
+ http {
137
+ include /etc/nginx/mime.types;
138
+ default_type application/octet-stream;
139
+ sendfile on;
140
+ keepalive_timeout 65;
141
+
142
+ server {
143
+ listen 7860;
144
+ server_name localhost;
145
+ location / {
146
+ root /usr/share/nginx/html;
147
+ index index.html index.htm;
148
+ }
149
+ }
150
+ }
151
+ EOF
152
 
153
  # 创建mime.types文件
154
  RUN echo 'types {' > /etc/nginx/mime.types && \