base on debian:testing; build asciidoc and serve it

This commit is contained in:
Christopher A. Mosher 2015-07-14 23:07:26 -04:00
parent e1221a4a3b
commit 8c745cbe45
12 changed files with 102 additions and 49 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
.git

View File

@ -1,9 +0,0 @@
language: cpp
compiler:
- gcc
install:
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
- sudo apt-get update
- sudo apt-get install libsdl2
before_script: ./bootstrap
script: ./configure && make

View File

@ -1,21 +1,30 @@
FROM ubuntu
FROM debian:testing
MAINTAINER Christopher A. Mosher <cmosher01@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install --no-install-recommends -y \
autoconf \
asciidoc \
automake \
build-essential \
libsdl2-dev \
nginx \
source-highlight \
supervisor \
xvfb \
x11vnc \
&& \
apt-get clean
WORKDIR /root/
COPY bootstrap ./
COPY NEWS ./
@ -32,11 +41,25 @@ COPY conf/ ./conf/
COPY installer/ ./installer/
COPY doc/ ./doc/
RUN ./bootstrap
RUN ./configure
RUN make
RUN make check
RUN make install
ENV BUILD_LOG /var/log/build.log
RUN ./bootstrap 2>&1 | tee -a $BUILD_LOG
RUN ./configure 2>&1 | tee -a $BUILD_LOG
RUN make 2>&1 | tee -a $BUILD_LOG
RUN make check 2>&1 | tee -a $BUILD_LOG
RUN make install 2>&1 | tee -a $BUILD_LOG
RUN make html 2>&1 | tee -a $BUILD_LOG
RUN make install-html 2>&1 | tee -a $BUILD_LOG
COPY nginx.conf /etc/nginx/
COPY default.nginx /etc/nginx/sites-available/default
RUN ln -s /usr/local/share/doc/epple2 /usr/share/nginx/html/epple2
# supervisor
CMD ["supervisord"]
@ -45,4 +68,4 @@ COPY supervisord.conf /etc/supervisor/conf.d/
ENV DISPLAY :0
ENV SDL_VIDEODRIVER x11
EXPOSE 5900
EXPOSE 80 5900

View File

@ -1,10 +1,2 @@
SUBDIRS = src conf installer
SUBDIRS = src conf installer doc
EXTRA_DIST = COPYING.sdl COPYING.other
.PHONY: site doc
site: doc
doc:
$(MAKE) -C $@ all
$(MAKE) -C $@ site

View File

@ -45,5 +45,5 @@ AC_CHECK_FUNCS([memset sqrt])
AC_CONFIG_FILES([Makefile src/Makefile conf/Makefile installer/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile conf/Makefile installer/Makefile doc/Makefile])
AC_OUTPUT

13
default.nginx Normal file
View File

@ -0,0 +1,13 @@
server {
listen 80 default_server;
index index.html;
if (-d $request_filename) {
rewrite [^/]$ $scheme://$http_host$uri/ permanent;
}
location / {
try_files $uri $uri/ =404;
}
}

View File

@ -1,20 +0,0 @@
.SUFFIXES: .asciidoc .html
.asciidoc.html :
asciidoc -b html5 $<
all : doc
doc : index.html
index.html : *.asciidoc
clean :
rm -f index.html
.PHONY: site
site :
mkdir -p site
cp *.html *.png *.gif site
cp -R callouts site

19
doc/Makefile.am Normal file
View File

@ -0,0 +1,19 @@
SUFFIXES = .asciidoc .html
.asciidoc.html :
asciidoc -b html5 $<
.PHONY : html install-html clean
html : index.html
index.html : *.asciidoc
install-html :
mkdir -p $(htmldir)
cp -R *.html *.png *.gif callouts $(htmldir)
clean :
rm -f index.html

View File

@ -3,3 +3,4 @@ epple2:
build: .
ports:
- "5900:5900"
- "8080:80"

27
nginx.conf Normal file
View File

@ -0,0 +1,27 @@
user root;
pid /run/nginx.pid;
events {
}
http {
port_in_redirect on;
disable_symlinks off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
include /etc/nginx/mime.types;
ssl_prefer_server_ciphers on;
error_log stderr debug;
access_log stderr;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

View File

@ -74,7 +74,7 @@ void ScreenImage::createScreen() {
printf("Unable to create window: %s\n", SDL_GetError());
throw ScreenException();
}
this->renderer = SDL_CreateRenderer(this->window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
this->renderer = SDL_CreateRenderer(this->window, -1, 0/*SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC*/);
if (this->renderer == NULL) {
std::cerr << SDL_GetError() << std::endl;
throw ScreenException();

View File

@ -8,7 +8,13 @@ redirect_stderr=true
stdout_logfile_maxbytes=0
[program:x11vnc]
command=x11vnc
command=x11vnc -forever
stdout_logfile=/dev/stdout
redirect_stderr=true
stdout_logfile_maxbytes=0
[program:nginx]
command=nginx -g "daemon off;"
stdout_logfile=/dev/stdout
redirect_stderr=true
stdout_logfile_maxbytes=0