mn9206986 commited on
Commit
b9adddc
·
verified ·
1 Parent(s): 88594a9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,13 +1,12 @@
1
  FROM ubuntu:22.04
2
 
3
- # Thiết lập non-interactive để tránh bị dừng khi cài đặt
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  TZ=Etc/UTC \
6
  DISPLAY=:0 \
7
  RESOLUTION=1920x1080x24 \
8
  PORT=7860
9
 
10
- # Cài đặt các dependencies (chạy với root trong giai đoạn build)
11
  RUN apt-get update && apt-get install -y \
12
  xvfb \
13
  novnc \
@@ -22,21 +21,21 @@ RUN apt-get update && apt-get install -y \
22
  RUN mkdir -p /usr/share/novnc/utils/websockify && \
23
  ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
24
 
25
- # Chuẩn bị thư mục cho user 1000 (UID mà Hugging Face sử dụng)
26
  RUN mkdir -p /home/user && \
27
  chown -R 1000:1000 /home/user && \
28
  mkdir -p /home/user/.config/chromium && \
29
  chown -R 1000:1000 /home/user/.config
30
 
31
- # Sao chép cấu hình supervisor
 
 
 
32
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
33
  RUN chown 1000:1000 /etc/supervisor/conf.d/supervisord.conf
34
 
35
- # Mở cổng noVNC
36
  EXPOSE 7860
37
 
38
- # Chuyển sang user 1000 (non-root) khi chạy
39
  USER 1000
40
 
41
- # Khởi chạy supervisor
42
- CMD ["/usr/bin/supervisord"]
 
1
  FROM ubuntu:22.04
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Etc/UTC \
5
  DISPLAY=:0 \
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 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
+ # Sửa PID file location cho non-root
31
+ RUN sed -i 's/\/var\/run/\/tmp/g' /etc/supervisor/supervisord.conf
32
+
33
+ # Copy cấu hình supervisor
34
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
35
  RUN chown 1000:1000 /etc/supervisor/conf.d/supervisord.conf
36
 
 
37
  EXPOSE 7860
38
 
 
39
  USER 1000
40
 
41
+ CMD ["/usr/bin/supervisord", "-n"]