File size: 1,287 Bytes
23cf472
84cc04d
23cf472
 
b425345
 
23cf472
1b9c3ec
23cf472
 
1b9c3ec
23cf472
 
4b3b18d
23cf472
1b9c3ec
23cf472
 
1b9c3ec
23cf472
8086017
 
 
 
23cf472
1b9c3ec
23cf472
a8902f5
23cf472
a8902f5
 
 
 
 
 
 
 
23cf472
 
1b9c3ec
23cf472
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM lbjlaq/antigravity-manager:latest
# update at 2026-3-12 v4.1.29
USER root

# 1. Install socat (port forwarding), xvfb (virtual display), and dbus-x11
RUN apt-get update && apt-get install -y socat xvfb dbus-x11 && rm -rf /var/lib/apt/lists/*

# 2. Specify working directory
WORKDIR /app

# 3. Set environment variables
ENV PORT=7860
EXPOSE 7860
ENV DISPLAY=:99

# 4. Create configuration directory and set permissions
RUN mkdir -p /root/.antigravity_tools && chmod -R 777 /root/.antigravity_tools

# 5. Write the startup script directly
RUN echo '#!/bin/bash\n\
echo "Starting Xvfb (Virtual Display)..."\n\
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &\n\
sleep 2\n\
\n\
echo "Starting Antigravity Tools..."\n\
# Adjust the path based on the actual image contents, usually ./antigravity-tools\n\
if [ -f "./antigravity-tools" ]; then\n\
    ./antigravity-tools headless &\n\
fi\n\
\n\
echo "Waiting for Antigravity Tools to open port 8045..."\n\
while ! timeout 1 bash -c "echo > /dev/tcp/127.0.0.1/8045" 2>/dev/null; do\n\
  sleep 1\n\
done\n\
\n\
echo "App is ready! Starting socat proxy 7860 -> 8045..."\n\
exec socat TCP-LISTEN:7860,fork,bind=0.0.0.0 TCP:127.0.0.1:8045\n\
' > /start.sh && chmod +x /start.sh

# 6. Run the script
ENTRYPOINT []
CMD ["/bin/bash", "/start.sh"]