Spaces:
Paused

mn9206986 commited on
Commit
d31dcce
·
verified ·
1 Parent(s): b92b9e8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -9
Dockerfile CHANGED
@@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
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 \
@@ -21,20 +21,17 @@ RUN apt-get update && apt-get install -y \
21
  RUN mkdir -p /usr/share/novnc/utils/websockify && \
22
  ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
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
@@ -42,7 +39,9 @@ RUN chown -R 1000:1000 /etc/supervisor/conf.d
42
 
43
  EXPOSE 7860
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"]
 
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 \
 
21
  RUN mkdir -p /usr/share/novnc/utils/websockify && \
22
  ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
23
 
24
+ # Chuẩn bị môi trường cho non-root
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 echo "[supervisord]" > /etc/supervisor/supervisord.conf && \
 
 
32
  echo "nodaemon=true" >> /etc/supervisor/supervisord.conf && \
33
  echo "logfile=/dev/null" >> /etc/supervisor/supervisord.conf && \
34
+ echo "pidfile=/tmp/supervisord.pid" >> /etc/supervisor/supervisord.conf
 
35
 
36
  # File cấu hình chương trình
37
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 
39
 
40
  EXPOSE 7860
41
 
42
+ # Sử dụng script khởi động đặc biệt
43
+ COPY entrypoint.sh /entrypoint.sh
44
+ RUN chmod +x /entrypoint.sh
45
  USER 1000
46
 
47
+ ENTRYPOINT ["/entrypoint.sh"]