Create Dockerfile
Browse files- Dockerfile +67 -0
Dockerfile
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ghcr.io/anthropics/anthropic-quickstarts:computer-use-demo-latest
|
2 |
+
|
3 |
+
# Install nginx
|
4 |
+
USER root
|
5 |
+
RUN apt-get update && apt-get install -y nginx
|
6 |
+
|
7 |
+
# Set working directory
|
8 |
+
WORKDIR /home/computeruse
|
9 |
+
|
10 |
+
# Create nginx configuration with improved WebSocket support
|
11 |
+
RUN echo '\
|
12 |
+
server {\n\
|
13 |
+
listen 8080;\n\
|
14 |
+
server_name _;\n\
|
15 |
+
\n\
|
16 |
+
location / {\n\
|
17 |
+
proxy_pass http://127.0.0.1:6080;\n\
|
18 |
+
proxy_http_version 1.1;\n\
|
19 |
+
proxy_set_header Upgrade $http_upgrade;\n\
|
20 |
+
proxy_set_header Connection "upgrade";\n\
|
21 |
+
proxy_set_header Host $host;\n\
|
22 |
+
proxy_set_header X-Real-IP $remote_addr;\n\
|
23 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
|
24 |
+
proxy_set_header X-Forwarded-Proto $scheme;\n\
|
25 |
+
proxy_buffering off;\n\
|
26 |
+
}\n\
|
27 |
+
\n\
|
28 |
+
location /streamlit/ {\n\
|
29 |
+
proxy_pass http://127.0.0.1:8501/;\n\
|
30 |
+
proxy_http_version 1.1;\n\
|
31 |
+
proxy_set_header Upgrade $http_upgrade;\n\
|
32 |
+
proxy_set_header Connection "upgrade";\n\
|
33 |
+
proxy_set_header Host $host;\n\
|
34 |
+
proxy_set_header X-Real-IP $remote_addr;\n\
|
35 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\
|
36 |
+
proxy_set_header X-Forwarded-Proto $scheme;\n\
|
37 |
+
proxy_buffering off;\n\
|
38 |
+
}\n\
|
39 |
+
\n\
|
40 |
+
location /noVNC/ {\n\
|
41 |
+
proxy_pass http://127.0.0.1:6080/;\n\
|
42 |
+
proxy_http_version 1.1;\n\
|
43 |
+
proxy_set_header Upgrade $http_upgrade;\n\
|
44 |
+
proxy_set_header Connection "upgrade";\n\
|
45 |
+
proxy_set_header Host $host;\n\
|
46 |
+
proxy_read_timeout 61s;\n\
|
47 |
+
proxy_buffering off;\n\
|
48 |
+
}\n\
|
49 |
+
}\n' > /etc/nginx/sites-available/default
|
50 |
+
|
51 |
+
# Expose only the main port
|
52 |
+
EXPOSE 8080
|
53 |
+
|
54 |
+
ENV PORT=8080
|
55 |
+
ENV STREAMLIT_SERVER_PORT=8501
|
56 |
+
ENV NOVNC_PORT=6080
|
57 |
+
ENV BASE_URL="/noVNC"
|
58 |
+
ENV STREAMLIT_BASE_URL="/streamlit"
|
59 |
+
|
60 |
+
# Create and set permissions for start script
|
61 |
+
COPY start.sh /start.sh
|
62 |
+
RUN chmod +x /start.sh
|
63 |
+
|
64 |
+
# Switch back to non-root user
|
65 |
+
USER 1000
|
66 |
+
|
67 |
+
CMD ["/start.sh"]
|