Spaces:
Paused

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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -44
Dockerfile CHANGED
@@ -1,47 +1,43 @@
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 \
13
- websockify \
14
- supervisor \
15
- chromium-browser \
16
- fluxbox \
17
- x11vnc \
18
- && rm -rf /var/lib/apt/lists/*
19
-
20
- # Cấu hình 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
38
- RUN chown -R 1000:1000 /etc/supervisor/conf.d
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"]
 
1
+ FROM debian:bookworm
2
+ LABEL description="Chrome With noVNC" \
3
+ maintainer="admin@fever.ink" \
4
+ version="2.0"
5
+
6
+ # Install Chrome
7
+ RUN \
8
+ apt update && \
9
+ apt upgrade -y && \
10
+ apt install --no-install-recommends -y wget && \
11
+ apt install --no-install-recommends -y fonts-droid-fallback && \
12
+ wget --no-check-certificate https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb && \
13
+ apt install --no-install-recommends -f -y /tmp/google-chrome-stable_current_amd64.deb && \
14
+ rm /tmp/google-chrome-stable_current_amd64.deb
15
+
16
+ # Install vnc server and noVNC
17
+ RUN \
18
+ apt install --no-install-recommends -y tightvncserver xfonts-base git websockify python3 net-tools procps && \
19
+ git clone https://github.com/novnc/noVNC.git /opt/novnc
20
+
21
+ # Configuration
22
+ COPY chrome-novnc.sh /usr/bin/chrome-novnc.sh
23
+ RUN \
24
+ ln -s /opt/novnc/vnc.html /opt/novnc/index.html && \
25
+ chmod +x /usr/bin/chrome-novnc.sh
26
+
27
+ ENV \
28
+ WIDTH=1280 \
29
+ HEIGHT=720 \
30
+ LANGUAGE=zh_CN.UTF-8 \
31
+ VNC_PASSWD=Binhminh12
32
+
 
 
 
 
 
 
 
33
  EXPOSE 7860
34
 
35
+ VOLUME /config
36
+
37
+ # Clean
38
+ RUN \
39
+ apt purge -y git && \
40
+ apt autoremove --purge -y && \
41
+ rm -rf /var/lib/apt/lists/*
42
 
43
+ CMD ["bash", "-c", "/usr/bin/chrome-novnc.sh"]