Spaces:
Paused
Paused
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an Ubuntu base image
|
| 2 |
+
FROM ubuntu:latest
|
| 3 |
+
|
| 4 |
+
# Install necessary packages
|
| 5 |
+
RUN apt-get update && \
|
| 6 |
+
apt-get install -y midori x11vnc xvfb && \
|
| 7 |
+
apt-get clean && \
|
| 8 |
+
rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Add a user with a home directory and switch to this user
|
| 11 |
+
RUN useradd -m -u 1000 user
|
| 12 |
+
USER user
|
| 13 |
+
|
| 14 |
+
# Set the working directory
|
| 15 |
+
WORKDIR /home/user
|
| 16 |
+
|
| 17 |
+
# Set environment variables for X11
|
| 18 |
+
ENV DISPLAY=:1
|
| 19 |
+
|
| 20 |
+
# Start the X virtual framebuffer and VNC server, then run Midori
|
| 21 |
+
CMD ["sh", "-c", "Xvfb :1 -screen 0 1024x768x16 & x11vnc -display :1 -nopw -listen localhost -xkb -forever & midori -e Fullscreen http://localhost:7860"]
|