Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +31 -2
Dockerfile
CHANGED
@@ -19,8 +19,36 @@ RUN apk update && apk add --no-cache \
|
|
19 |
&& chmod -R 777 /app/uploads/temp \
|
20 |
&& chmod -R 777 /app/client/public/images \
|
21 |
&& chmod -R 777 /app/api/logs
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
# ===== Admin Panel =====
|
25 |
COPY <<"EOF" /app/admin/app.py
|
26 |
from flask import Flask, request, jsonify, render_template
|
@@ -295,6 +323,7 @@ http {
|
|
295 |
}
|
296 |
|
297 |
access_log /app/nginx/logs/access.log;
|
|
|
298 |
}
|
299 |
}
|
300 |
EOF
|
|
|
19 |
&& chmod -R 777 /app/uploads/temp \
|
20 |
&& chmod -R 777 /app/client/public/images \
|
21 |
&& chmod -R 777 /app/api/logs
|
22 |
+
&& mkdir -p /app/{nginx/{logs,tmp,client_body},admin/{templates,static},data,uploads,client/public/images,api/logs} \
|
23 |
+
&& mkdir -p /app/nginx/client_body \
|
24 |
+
&& chmod -R 777 /app/nginx/client_body
|
25 |
+
# 2. Recompile NGINX with custom paths (critical fix)
|
26 |
+
RUN apk add --no-cache --virtual .build-deps \
|
27 |
+
build-base \
|
28 |
+
linux-headers \
|
29 |
+
openssl-dev \
|
30 |
+
pcre-dev \
|
31 |
+
zlib-dev \
|
32 |
+
&& wget http://nginx.org/download/nginx-1.24.0.tar.gz \
|
33 |
+
&& tar xzf nginx-1.24.0.tar.gz \
|
34 |
+
&& cd nginx-1.24.0 \
|
35 |
+
&& ./configure \
|
36 |
+
--prefix=/app/nginx \
|
37 |
+
--sbin-path=/usr/sbin/nginx \
|
38 |
+
--conf-path=/app/nginx/nginx.conf \
|
39 |
+
--error-log-path=/app/nginx/logs/error.log \
|
40 |
+
--pid-path=/app/nginx/nginx.pid \
|
41 |
+
--lock-path=/app/nginx/nginx.lock \
|
42 |
+
--http-log-path=/app/nginx/logs/access.log \
|
43 |
+
--http-client-body-temp-path=/app/nginx/client_body \
|
44 |
+
--http-proxy-temp-path=/app/nginx/tmp \
|
45 |
+
--http-fastcgi-temp-path=/app/nginx/tmp \
|
46 |
+
--user=nginx \
|
47 |
+
--group=nginx \
|
48 |
+
&& make \
|
49 |
+
&& make install \
|
50 |
+
&& apk del .build-deps \
|
51 |
+
&& rm -rf /nginx-1.24.0*
|
52 |
# ===== Admin Panel =====
|
53 |
COPY <<"EOF" /app/admin/app.py
|
54 |
from flask import Flask, request, jsonify, render_template
|
|
|
323 |
}
|
324 |
|
325 |
access_log /app/nginx/logs/access.log;
|
326 |
+
|
327 |
}
|
328 |
}
|
329 |
EOF
|