mn9206986 commited on
Commit
057550c
·
verified ·
1 Parent(s): c4c6c29

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -10
Dockerfile CHANGED
@@ -1,6 +1,13 @@
1
  FROM ubuntu:22.04
2
 
3
- # Cài đặt các dependencies
 
 
 
 
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  xvfb \
6
  novnc \
@@ -15,19 +22,21 @@ RUN apt-get update && apt-get install -y \
15
  RUN mkdir -p /usr/share/novnc/utils/websockify && \
16
  ln -s /usr/share/novnc/vnc.html /usr/share/novnc/index.html
17
 
18
- # Tạo thư mục cấu hình Chromium
19
- RUN mkdir -p /root/.config/chromium
 
 
 
20
 
21
- # File cấu hình supervisor
22
  COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
23
-
24
- # Thiết lập biến môi trường
25
- ENV DISPLAY=:0 \
26
- RESOLUTION=1920x1080x24 \
27
- PORT=7860
28
 
29
  # Mở cổng noVNC
30
  EXPOSE 7860
31
 
32
- # Khởi chạy supervisor (chạy với root)
 
 
 
33
  CMD ["/usr/bin/supervisord"]
 
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
  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"]