Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +14 -10
Dockerfile
CHANGED
@@ -19,7 +19,7 @@ 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 |
-
RUN mkdir -p /app/{nginx/{
|
23 |
|
24 |
# ===== Admin Panel =====
|
25 |
COPY <<"EOF" /app/admin/app.py
|
@@ -245,13 +245,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
245 |
});
|
246 |
EOF
|
247 |
|
248 |
-
|
249 |
-
COPY <<"EOF" /app/nginx/conf/nginx.conf
|
250 |
-
user 1000;
|
251 |
worker_processes auto;
|
252 |
|
253 |
error_log /app/nginx/logs/error.log warn;
|
254 |
-
pid /
|
255 |
|
256 |
events {
|
257 |
worker_connections 1024;
|
@@ -263,6 +261,12 @@ http {
|
|
263 |
sendfile on;
|
264 |
keepalive_timeout 65;
|
265 |
client_max_body_size 20M;
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
server {
|
268 |
listen 7860;
|
@@ -294,7 +298,7 @@ http {
|
|
294 |
}
|
295 |
}
|
296 |
EOF
|
297 |
-
|
298 |
# Startup script
|
299 |
COPY <<"EOF" /start.sh
|
300 |
#!/bin/sh
|
@@ -303,13 +307,13 @@ COPY <<"EOF" /start.sh
|
|
303 |
#chmod -R 770 /var/lib/nginx
|
304 |
|
305 |
# Start LibreChat (using the correct command)
|
306 |
-
cd /app && npm run &
|
307 |
|
308 |
# Start Admin Panel
|
309 |
cd /app/admin && python3 app.py &
|
310 |
|
311 |
# Start NGINX
|
312 |
-
nginx -
|
313 |
|
314 |
# Keep container running
|
315 |
wait
|
@@ -328,8 +332,8 @@ ENV HOST=0.0.0.0 \
|
|
328 |
CUSTOM_FOOTER=EasierIT \
|
329 |
MONGO_URI="$MONGO_URI" \
|
330 |
SUDO_SECRET="$SUDO_SECRET" \
|
331 |
-
FLASK_SECRET="$FLASK_SECRET"
|
332 |
-
|
333 |
|
334 |
EXPOSE 7860
|
335 |
CMD ["/start.sh"]
|
|
|
19 |
&& chmod -R 777 /app/uploads/temp \
|
20 |
&& chmod -R 777 /app/client/public/images \
|
21 |
&& chmod -R 777 /app/api/logs
|
22 |
+
RUN mkdir -p /app/{nginx/{logs,tmp,client_body},admin/{templates,static},data,uploads,client/public/images,api/logs}
|
23 |
|
24 |
# ===== Admin Panel =====
|
25 |
COPY <<"EOF" /app/admin/app.py
|
|
|
245 |
});
|
246 |
EOF
|
247 |
|
248 |
+
COPY <<"EOF" /app/nginx/nginx.conf
|
|
|
|
|
249 |
worker_processes auto;
|
250 |
|
251 |
error_log /app/nginx/logs/error.log warn;
|
252 |
+
pid /tmp/nginx.pid;
|
253 |
|
254 |
events {
|
255 |
worker_connections 1024;
|
|
|
261 |
sendfile on;
|
262 |
keepalive_timeout 65;
|
263 |
client_max_body_size 20M;
|
264 |
+
|
265 |
+
client_body_temp_path /app/nginx/client_body;
|
266 |
+
proxy_temp_path /app/nginx/tmp;
|
267 |
+
fastcgi_temp_path /app/nginx/tmp;
|
268 |
+
uwsgi_temp_path /app/nginx/tmp;
|
269 |
+
scgi_temp_path /app/nginx/tmp;
|
270 |
|
271 |
server {
|
272 |
listen 7860;
|
|
|
298 |
}
|
299 |
}
|
300 |
EOF
|
301 |
+
RUN chmod 777 /app/nginx/nginx.conf
|
302 |
# Startup script
|
303 |
COPY <<"EOF" /start.sh
|
304 |
#!/bin/sh
|
|
|
307 |
#chmod -R 770 /var/lib/nginx
|
308 |
|
309 |
# Start LibreChat (using the correct command)
|
310 |
+
cd /app && npm run backend &
|
311 |
|
312 |
# Start Admin Panel
|
313 |
cd /app/admin && python3 app.py &
|
314 |
|
315 |
# Start NGINX
|
316 |
+
nginx -c /app/nginx/nginx.conf -g "daemon off;"
|
317 |
|
318 |
# Keep container running
|
319 |
wait
|
|
|
332 |
CUSTOM_FOOTER=EasierIT \
|
333 |
MONGO_URI="$MONGO_URI" \
|
334 |
SUDO_SECRET="$SUDO_SECRET" \
|
335 |
+
FLASK_SECRET="$FLASK_SECRET" \
|
336 |
+
NODE_ENV=production
|
337 |
|
338 |
EXPOSE 7860
|
339 |
CMD ["/start.sh"]
|