mn9206986 commited on
Commit
30c6910
·
verified ·
1 Parent(s): e7e84d6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -9
Dockerfile CHANGED
@@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
6
  RESOLUTION=1920x1080x24 \
7
  PORT=7860
8
 
9
- # Cài đặt dependencies
10
  RUN apt-get update && apt-get install -y \
11
  xvfb \
12
  novnc \
@@ -23,19 +23,20 @@ RUN mkdir -p /usr/share/novnc/utils/websockify && \
23
 
24
  # Chuẩn bị môi trường cho user 1000
25
  RUN mkdir -p /home/user && \
26
- mkdir -p /tmp/supervisor && \
27
  chown -R 1000:1000 /home/user && \
28
  mkdir -p /home/user/.config/chromium && \
29
  chown -R 1000:1000 /home/user/.config
30
 
31
- # Sửa cấu hình Supervisor để dùng thư mục tạm
32
- RUN echo "[supervisord]" > /etc/supervisor/supervisord.conf && \
 
 
33
  echo "nodaemon=true" >> /etc/supervisor/supervisord.conf && \
34
- echo "logfile=/tmp/supervisor/supervisord.log" >> /etc/supervisor/supervisord.conf && \
35
- echo "pidfile=/tmp/supervisor/supervisord.pid" >> /etc/supervisor/supervisord.conf && \
36
- echo "childlogdir=/tmp/supervisor" >> /etc/supervisor/supervisord.conf
37
 
38
- # Copy cấu hình chương trình
39
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
40
  RUN chown -R 1000:1000 /etc/supervisor/conf.d
41
 
@@ -43,4 +44,5 @@ EXPOSE 7860
43
 
44
  USER 1000
45
 
46
- CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
 
 
6
  RESOLUTION=1920x1080x24 \
7
  PORT=7860
8
 
9
+ # Cài đặt dependencies với quyền root
10
  RUN apt-get update && apt-get install -y \
11
  xvfb \
12
  novnc \
 
23
 
24
  # Chuẩn bị môi trường cho user 1000
25
  RUN mkdir -p /home/user && \
 
26
  chown -R 1000:1000 /home/user && \
27
  mkdir -p /home/user/.config/chromium && \
28
  chown -R 1000:1000 /home/user/.config
29
 
30
+ # Cấu hình Supervisor đặc biệt cho non-root
31
+ RUN mkdir -p /tmp/supervisor && \
32
+ chown -R 1000:1000 /tmp/supervisor && \
33
+ echo "[supervisord]" > /etc/supervisor/supervisord.conf && \
34
  echo "nodaemon=true" >> /etc/supervisor/supervisord.conf && \
35
+ echo "logfile=/dev/null" >> /etc/supervisor/supervisord.conf && \
36
+ echo "pidfile=/tmp/supervisord.pid" >> /etc/supervisor/supervisord.conf && \
37
+ echo "user=1000" >> /etc/supervisor/supervisord.conf
38
 
39
+ # File cấu hình chương trình
40
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
41
  RUN chown -R 1000:1000 /etc/supervisor/conf.d
42
 
 
44
 
45
  USER 1000
46
 
47
+ # Sử dụng wrapper script để khởi động
48
+ CMD ["bash", "-c", "mkdir -p /tmp/supervisor && /usr/bin/supervisord -c /etc/supervisor/supervisord.conf"]