AZILS commited on
Commit
6c54906
·
verified ·
1 Parent(s): ea7bf08

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -27
Dockerfile CHANGED
@@ -3,24 +3,13 @@ FROM ubuntu:22.04
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
- # Install all core and extended libraries for VS Code Web engine
7
  RUN apt update && \
8
  apt install -y \
9
- curl \
10
- gnupg \
11
- apt-transport-https \
12
- ca-certificates \
13
- python3 \
14
- libatomic1 \
15
- libgbm1 \
16
- libasound2 \
17
- libxshmfence1 \
18
- libnss3 \
19
- libkrb5-3 \
20
- libonig5 \
21
- git \
22
- sudo \
23
- wget
24
 
25
  # Add Antigravity official repository
26
  RUN mkdir -p /etc/apt/keyrings && \
@@ -29,13 +18,18 @@ RUN mkdir -p /etc/apt/keyrings && \
29
  echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev/ antigravity-debian main" | \
30
  tee /etc/apt/sources.list.d/antigravity.list > /dev/null
31
 
32
- # Install FULL Antigravity suite
33
  RUN apt update && apt install -y antigravity
34
 
35
- # CRITICAL FIX: The launcher looks for the tunnel binary in a specific path
36
- # We create the path and symlink the main binary to 'antigravity-tunnel'
 
 
 
 
37
  RUN mkdir -p /usr/share/antigravity/bin && \
38
- ln -s /usr/bin/antigravity /usr/share/antigravity/bin/antigravity-tunnel
 
39
 
40
  # Configure Hugging Face user
41
  RUN useradd -m -u 1000 user && \
@@ -44,15 +38,15 @@ USER user
44
  ENV HOME=/home/user
45
  WORKDIR /home/user
46
 
47
- # Create needed directories for VS Code data
48
- RUN mkdir -p /home/user/.antigravity-server /home/user/.antigravity-extensions
49
 
50
- # Set environment variables
51
- ENV PORT=7860
 
52
 
53
  # Expose port
54
  EXPOSE 7860
55
 
56
- # Start the REAL VS Code Web Server
57
- # We use --host 0.0.0.0 and --port 7860 for Hugging Face
58
- CMD ["antigravity", "serve-web", "--host", "0.0.0.0", "--port", "7860", "--accept-server-license-terms", "--without-connection-token"]
 
3
 
4
  ENV DEBIAN_FRONTEND=noninteractive
5
 
6
+ # Install core and GUI-support libraries
7
  RUN apt update && \
8
  apt install -y \
9
+ curl gnupg apt-transport-https ca-certificates python3 \
10
+ libatomic1 libgbm1 libasound2 libxshmfence1 libnss3 libkrb5-3 libonig5 \
11
+ libx11-6 libxkbfile1 \
12
+ git sudo wget sed
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  # Add Antigravity official repository
15
  RUN mkdir -p /etc/apt/keyrings && \
 
18
  echo "deb [signed-by=/etc/apt/keyrings/antigravity-repo-key.gpg] https://us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev/ antigravity-debian main" | \
19
  tee /etc/apt/sources.list.d/antigravity.list > /dev/null
20
 
21
+ # Install Antigravity
22
  RUN apt update && apt install -y antigravity
23
 
24
+ # FIX: Instead of symlinking to the main script (which causes recursion),
25
+ # we will find the real internal binary or use a dummy launcher.
26
+ # Often the real binary is inside /usr/lib/antigravity or /opt/antigravity
27
+ RUN find / -name "*antigravity*" -type f -executable 2>/dev/null > /home/antigravity_files.txt || true
28
+
29
+ # We will create a DUMMY tunnel script that doesn't fork bomb
30
  RUN mkdir -p /usr/share/antigravity/bin && \
31
+ echo '#!/bin/bash\nexit 0' > /usr/share/antigravity/bin/antigravity-tunnel && \
32
+ chmod +x /usr/share/antigravity/bin/antigravity-tunnel
33
 
34
  # Configure Hugging Face user
35
  RUN useradd -m -u 1000 user && \
 
38
  ENV HOME=/home/user
39
  WORKDIR /home/user
40
 
41
+ # Setup workspace and VS Code dirs
42
+ RUN mkdir -p /home/user/workspace /home/user/.antigravity-server /home/user/.antigravity-extensions
43
 
44
+ # Copy and fix the startup script
45
+ COPY --chown=user:user run_app.sh /home/user/run_app.sh
46
+ RUN chmod +x /home/user/run_app.sh && sed -i 's/\r$//' /home/user/run_app.sh
47
 
48
  # Expose port
49
  EXPOSE 7860
50
 
51
+ # Start via the wrapper script
52
+ CMD ["/bin/bash", "/home/user/run_app.sh"]