Skip to content

Commit 8cf04c4

Browse files
committed
Responsive x11 size
1 parent 5d706b6 commit 8cf04c4

File tree

7 files changed

+83
-600
lines changed

7 files changed

+83
-600
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:14.04
1+
FROM ubuntu:14.04.2
22
MAINTAINER Doro Wu <fcwu.tw@gmail.com>
33

44
ENV DEBIAN_FRONTEND noninteractive
@@ -14,16 +14,19 @@ RUN apt-get update \
1414
fonts-wqy-microhei \
1515
language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw \
1616
nginx \
17-
python-pip \
17+
python-pip python-dev build-essential \
1818
&& apt-get autoclean \
1919
&& apt-get autoremove \
2020
&& rm -rf /var/lib/apt/lists/*
2121

22+
ADD web /web/
23+
RUN pip install -r /web/requirements.txt
2224

2325
ADD noVNC /noVNC/
2426
ADD nginx.conf /etc/nginx/sites-enabled/default
2527
ADD startup.sh /
26-
ADD supervisord.conf /etc/
28+
ADD supervisord.conf /etc/supervisor/conf.d/
29+
2730
EXPOSE 6080
2831
WORKDIR /root
2932
ENTRYPOINT ["/startup.sh"]

nginx.conf

Lines changed: 19 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
# You may add here your
2-
# server {
3-
# ...
4-
# }
5-
# statements for each of your virtual hosts to this file
6-
7-
##
8-
# You should look at the following URL's in order to grasp a solid understanding
9-
# of Nginx configuration files in order to fully unleash the power of Nginx.
10-
# http://wiki.nginx.org/Pitfalls
11-
# http://wiki.nginx.org/QuickStart
12-
# http://wiki.nginx.org/Configuration
13-
#
14-
# Generally, you will want to move this file somewhere, and start with a clean
15-
# file but keep this around for reference. Or just disable in sites-enabled.
16-
#
17-
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
18-
##
19-
201
server {
212
listen 6080 default_server;
223
listen [::]:6080 default_server ipv6only=on;
@@ -25,7 +6,23 @@ server {
256
index index.html index.htm;
267

278
location / {
28-
try_files $uri $uri/ @proxy;
9+
try_files $uri @proxy;
10+
}
11+
12+
location = / {
13+
try_files $uri @proxy2;
14+
}
15+
16+
location = /redirect.html {
17+
try_files $uri @proxy2;
18+
}
19+
20+
location @proxy2 {
21+
proxy_set_header X-Real-IP $remote_addr;
22+
proxy_set_header X-Forwarded-For $remote_addr;
23+
proxy_set_header Host $host;
24+
proxy_pass http://127.0.0.1:6079;
25+
max_ranges 0;
2926
}
3027

3128
location @proxy {
@@ -36,93 +33,10 @@ server {
3633
max_ranges 0;
3734
}
3835

39-
location /websockify {
40-
proxy_pass http://127.0.0.1:6081;
36+
location = /websockify {
4137
proxy_http_version 1.1;
4238
proxy_set_header Upgrade $http_upgrade;
4339
proxy_set_header Connection "upgrade";
40+
proxy_pass http://127.0.0.1:6081;
4441
}
45-
46-
#location / {
47-
# # First attempt to serve request as file, then
48-
# # as directory, then fall back to displaying a 404.
49-
# try_files $uri $uri/ =404;
50-
# # Uncomment to enable naxsi on this location
51-
# # include /etc/nginx/naxsi.rules
52-
# }
53-
54-
# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
55-
#location /RequestDenied {
56-
# proxy_pass http://127.0.0.1:8080;
57-
#}
58-
59-
#error_page 404 /404.html;
60-
61-
# redirect server error pages to the static page /50x.html
62-
#
63-
#error_page 500 502 503 504 /50x.html;
64-
#location = /50x.html {
65-
# root /usr/share/nginx/html;
66-
#}
67-
68-
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
69-
#
70-
#location ~ \.php$ {
71-
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
72-
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
73-
#
74-
# # With php5-cgi alone:
75-
# fastcgi_pass 127.0.0.1:9000;
76-
# # With php5-fpm:
77-
# fastcgi_pass unix:/var/run/php5-fpm.sock;
78-
# fastcgi_index index.php;
79-
# include fastcgi_params;
80-
#}
81-
82-
# deny access to .htaccess files, if Apache's document root
83-
# concurs with nginx's one
84-
#
85-
#location ~ /\.ht {
86-
# deny all;
87-
#}
8842
}
89-
90-
91-
# another virtual host using mix of IP-, name-, and port-based configuration
92-
#
93-
#server {
94-
# listen 8000;
95-
# listen somename:8080;
96-
# server_name somename alias another.alias;
97-
# root html;
98-
# index index.html index.htm;
99-
#
100-
# location / {
101-
# try_files $uri $uri/ =404;
102-
# }
103-
#}
104-
105-
106-
# HTTPS server
107-
#
108-
#server {
109-
# listen 443;
110-
# server_name localhost;
111-
#
112-
# root html;
113-
# index index.html index.htm;
114-
#
115-
# ssl on;
116-
# ssl_certificate cert.pem;
117-
# ssl_certificate_key cert.key;
118-
#
119-
# ssl_session_timeout 5m;
120-
#
121-
# ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
122-
# ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
123-
# ssl_prefer_server_ciphers on;
124-
#
125-
# location / {
126-
# try_files $uri $uri/ =404;
127-
# }
128-
#}

noVNC/vnc_auto.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
<body style="margin: 0px;">
4747
<div id="noVNC_screen">
48-
<div id="noVNC_status_bar" class="noVNC_status_bar" style="margin-top: 0px;">
48+
<div id="noVNC_status_bar" class="noVNC_status_bar" style="margin-top: 0px; height: 0px;">
4949
<table border=0 width="100%"><tr>
5050
<td><div id="noVNC_status" style="position: relative; height: auto;">
5151
Loading

startup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ PASS=ubuntu
99
id -u ubuntu &>/dev/null || useradd --create-home --shell /bin/bash --user-group --groups adm,sudo ubuntu
1010
echo "ubuntu:$PASS" | chpasswd
1111

12-
/usr/bin/supervisord -c /etc/supervisord.conf -n
12+
cd /web && ./run.py > /var/log/web.log 2>&1 &
13+
nginx -c /etc/nginx/nginx.conf
14+
/usr/bin/supervisord -n

supervisord.conf

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
[supervisord]
2-
nodaemon=true
3-
logfile_maxbytes=10MB
4-
pidfile=/var/run/supervisord.pid
5-
logfile=/var/log/supervisord.log
6-
nodaemon=false
7-
8-
[supervisorctl]
9-
serverurl=unix:///var/run/supervisor.sock
10-
111
[program:xvfb]
122
priority=10
133
directory=/
@@ -45,7 +35,7 @@ redirect_stderr=true
4535
[program:novnc]
4636
priority=25
4737
directory=/noVNC
48-
command=/noVNC/utils/launch.sh
38+
command=/noVNC/utils/launch.sh --listen 6081
4939
user=root
5040
autostart=true
5141
autorestart=true

0 commit comments

Comments
 (0)