You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2015/11/12 15:55:48 UTC

[1/6] marmotta git commit: MARMOTTA-588: moved docker stuff to the webapp launcher

Repository: marmotta
Updated Branches:
  refs/heads/MARMOTTA-588 78ca9bfcf -> 2fa66e7de


MARMOTTA-588: moved docker stuff to the webapp launcher


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/aa16fbcc
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/aa16fbcc
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/aa16fbcc

Branch: refs/heads/MARMOTTA-588
Commit: aa16fbccdcfb198068513f998442e391a2d1e17c
Parents: 78ca9bf
Author: Sergio Fernández <wi...@apache.org>
Authored: Tue Nov 10 12:17:56 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Tue Nov 10 12:17:56 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-docker/Dockerfile | 53 -------------------------------
 launchers/marmotta-docker/README.md  | 21 ------------
 launchers/marmotta-webapp/Dockerfile | 53 +++++++++++++++++++++++++++++++
 launchers/marmotta-webapp/README.md  | 21 ++++++++++++
 4 files changed, 74 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/aa16fbcc/launchers/marmotta-docker/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-docker/Dockerfile b/launchers/marmotta-docker/Dockerfile
deleted file mode 100644
index 2eb235c..0000000
--- a/launchers/marmotta-docker/Dockerfile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Dockerfile for Apache Marmotta
-
-FROM debian:sid
-MAINTAINER Sergio Fernández <wi...@apache.org>
-WORKDIR /src
-EXPOSE 8080
-EXPOSE 5432
-
-# general configuration
-ENV DEBIAN_FRONTEND noninteractive
-ENV baseurl http://localhost:8080/marmotta
-ENV dbname marmotta
-ENV dbuser marmotta
-ENV dbpass s3cr3t
-ENV conf /var/lib/marmotta/system-config.properties
-
-# install base system
-RUN sed -i.bak s/"exit 101"/"exit 0"/g /usr/sbin/policy-rc.d
-RUN apt-get update
-RUN apt-get install -y apt-utils
-RUN apt-get upgrade -y
-RUN apt-get install -y sudo
-RUN apt-get install -y locales
-RUN locale-gen en_US.UTF-8 en_us && dpkg-reconfigure locales && dpkg-reconfigure locales && locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
-RUN apt-get install -y git ssmtp
-RUN apt-get install -y openjdk-7-jre-headless openjdk-7-jdk maven
-RUN apt-get install -y tomcat7
-RUN apt-get install -y postgresql postgresql-common postgresql-contrib
-
-# pre-setup
-USER postgres
-RUN psql -c "CREATE USER $dbuser WITH PASSWORD '$dbpass'"
-RUN psql -c "CREATE DATABASE $dbname WITH OWNER $dbuser"
-USER root
-RUN mkdir -p "$(dirname $conf)"
-RUN echo "" > $conf
-RUN echo "security.enabled = false" >> $conf
-RUN echo "database.type = postgres" >> $conf
-RUN echo "database.url = jdbc:postgresql://localhost:5432/$dbname?prepareThreshold=3" >> $conf
-RUN echo "database.user = $dbuser" >> $conf
-RUN echo "database.password = $dbpas" >> $conf
-RUN chmod -R tomcat7:tomcat7 "$(dirname $conf)"
-
-# package from source code and install the webapp
-RUN git clone -b develop https://git-wip-us.apache.org/repos/asf/marmotta.git
-RUN cd marmotta/launchers/marmotta-webapp/ && mvn clean package -Djdeb.signing=false
-RUN dpkg -i marmotta/launchers/marmotta-webapp/target/marmotta*.deb
-
-# cleanup
-#RUN cd marmotta/ && mvn clean
-RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
-RUN mv /usr/sbin/policy-rc.d.bak /usr/sbin/policy-rc.d
-

http://git-wip-us.apache.org/repos/asf/marmotta/blob/aa16fbcc/launchers/marmotta-docker/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-docker/README.md b/launchers/marmotta-docker/README.md
deleted file mode 100644
index 9e45c2a..0000000
--- a/launchers/marmotta-docker/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Apache Marmotta Docker launcher
-
-This launcher creates a Docker images that you can user for developing or testing
-Apache Marmotta.
-
-## Build image
-
-    sudo docker build -t marmotta .
-
-## Get image
-
-@@TODO@@: push it to asf or docker hub
-
-## Run
-
-    docker run -p 8080:8080
-
-## Accesss
-
-Access Marmotta runing inside the container, at [172.17.42.1:8080/marmotta](http://172.17.42.1:8080/marmotta) 
-(IP address may be different, use `docker inspect CONTAINER_ID` for details).

http://git-wip-us.apache.org/repos/asf/marmotta/blob/aa16fbcc/launchers/marmotta-webapp/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/Dockerfile b/launchers/marmotta-webapp/Dockerfile
new file mode 100644
index 0000000..2eb235c
--- /dev/null
+++ b/launchers/marmotta-webapp/Dockerfile
@@ -0,0 +1,53 @@
+# Dockerfile for Apache Marmotta
+
+FROM debian:sid
+MAINTAINER Sergio Fernández <wi...@apache.org>
+WORKDIR /src
+EXPOSE 8080
+EXPOSE 5432
+
+# general configuration
+ENV DEBIAN_FRONTEND noninteractive
+ENV baseurl http://localhost:8080/marmotta
+ENV dbname marmotta
+ENV dbuser marmotta
+ENV dbpass s3cr3t
+ENV conf /var/lib/marmotta/system-config.properties
+
+# install base system
+RUN sed -i.bak s/"exit 101"/"exit 0"/g /usr/sbin/policy-rc.d
+RUN apt-get update
+RUN apt-get install -y apt-utils
+RUN apt-get upgrade -y
+RUN apt-get install -y sudo
+RUN apt-get install -y locales
+RUN locale-gen en_US.UTF-8 en_us && dpkg-reconfigure locales && dpkg-reconfigure locales && locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
+RUN apt-get install -y git ssmtp
+RUN apt-get install -y openjdk-7-jre-headless openjdk-7-jdk maven
+RUN apt-get install -y tomcat7
+RUN apt-get install -y postgresql postgresql-common postgresql-contrib
+
+# pre-setup
+USER postgres
+RUN psql -c "CREATE USER $dbuser WITH PASSWORD '$dbpass'"
+RUN psql -c "CREATE DATABASE $dbname WITH OWNER $dbuser"
+USER root
+RUN mkdir -p "$(dirname $conf)"
+RUN echo "" > $conf
+RUN echo "security.enabled = false" >> $conf
+RUN echo "database.type = postgres" >> $conf
+RUN echo "database.url = jdbc:postgresql://localhost:5432/$dbname?prepareThreshold=3" >> $conf
+RUN echo "database.user = $dbuser" >> $conf
+RUN echo "database.password = $dbpas" >> $conf
+RUN chmod -R tomcat7:tomcat7 "$(dirname $conf)"
+
+# package from source code and install the webapp
+RUN git clone -b develop https://git-wip-us.apache.org/repos/asf/marmotta.git
+RUN cd marmotta/launchers/marmotta-webapp/ && mvn clean package -Djdeb.signing=false
+RUN dpkg -i marmotta/launchers/marmotta-webapp/target/marmotta*.deb
+
+# cleanup
+#RUN cd marmotta/ && mvn clean
+RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
+RUN mv /usr/sbin/policy-rc.d.bak /usr/sbin/policy-rc.d
+

http://git-wip-us.apache.org/repos/asf/marmotta/blob/aa16fbcc/launchers/marmotta-webapp/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/README.md b/launchers/marmotta-webapp/README.md
new file mode 100644
index 0000000..9e45c2a
--- /dev/null
+++ b/launchers/marmotta-webapp/README.md
@@ -0,0 +1,21 @@
+# Apache Marmotta Docker launcher
+
+This launcher creates a Docker images that you can user for developing or testing
+Apache Marmotta.
+
+## Build image
+
+    sudo docker build -t marmotta .
+
+## Get image
+
+@@TODO@@: push it to asf or docker hub
+
+## Run
+
+    docker run -p 8080:8080
+
+## Accesss
+
+Access Marmotta runing inside the container, at [172.17.42.1:8080/marmotta](http://172.17.42.1:8080/marmotta) 
+(IP address may be different, use `docker inspect CONTAINER_ID` for details).


[2/6] marmotta git commit: postgresql>=9.4 is recommended

Posted by wi...@apache.org.
postgresql>=9.4 is recommended


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/f825e57a
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/f825e57a
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/f825e57a

Branch: refs/heads/MARMOTTA-588
Commit: f825e57a4a5c4da28f54be106ee1f075944c4333
Parents: aa16fbc
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 11:52:34 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 11:52:34 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-webapp/src/deb/control/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/f825e57a/launchers/marmotta-webapp/src/deb/control/control
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/src/deb/control/control b/launchers/marmotta-webapp/src/deb/control/control
index 99b5095..07bd576 100644
--- a/launchers/marmotta-webapp/src/deb/control/control
+++ b/launchers/marmotta-webapp/src/deb/control/control
@@ -22,7 +22,7 @@ Distribution: ldstack-nightly
 Maintainer: Apache Marmotta Community <de...@marmotta.apache.org>
 Replaces: marmotta-webapp
 Pre-Depends: tomcat7 (>=7.0.30-1) | tomcat8
-Suggests: postgresql (>=9.1)
+Suggests: postgresql (>=9.4)
 Description: Apache Marmotta is an Open Platform for Linked Data.
  The goal of Apache Marmotta is to provide an open implementation of a Linked 
  Data Platform that can be used, extended and deployed easily by organizations 


[6/6] marmotta git commit: MARMOTTA-588: added more documentation

Posted by wi...@apache.org.
MARMOTTA-588: added more documentation


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/2fa66e7d
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/2fa66e7d
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/2fa66e7d

Branch: refs/heads/MARMOTTA-588
Commit: 2fa66e7de4ea1fa6f4d5f40894224c9856fb0ba5
Parents: 92fadba
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 15:55:25 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 15:55:25 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-webapp/README.md | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/2fa66e7d/launchers/marmotta-webapp/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/README.md b/launchers/marmotta-webapp/README.md
index d1ace68..8e361a6 100644
--- a/launchers/marmotta-webapp/README.md
+++ b/launchers/marmotta-webapp/README.md
@@ -16,17 +16,22 @@ The build also provides supprt for Debian packages, just append the profile to t
 
     mvn package -Pdebian
 
-and you'll find the `.deb` file `target/`.
+and you can find the `.deb` file under `target/`.
 
 ## Docker
 
-It also comes witth support for creating a Docker images that you can user for developing or testing
-Apache Marmotta.
+It also comes with support for creating a Docker images that you can user for developing or testing:
 
 * Build image: `docker build -t marmotta .`
-* Run the image: `docker run -p 8080:8080 marmotta`
+* Run the container: `docker run -p 8080:8080 marmotta`
 * Access Marmotta at [localhost:8080/marmotta](http://localhost:8080/marmotta) (IP address may be different, 
-  use `docker inspect CONTAINER_ID` for details).
+  see point bellow).
+* Get details about the container: `docker ps --filter "ancestor=marmotta` and `docker inspect CONTAINER_ID`.
+* Get basic statistics about the container: `docker stats [CONTAINERID] `
+* Commit the container changes to a new image: `docker commit [CONTAINERID] my-marmotta`
+* Stop the container: `docker stop [CONTAINERID]`
+
+For further instructions, please take a look to the [Docker User Guide](https://docs.docker.com/userguide/).
 
 @@TODO@@: push it to asf or docker hub
 


[4/6] marmotta git commit: MARMOTTA-588: updated doc

Posted by wi...@apache.org.
MARMOTTA-588: updated doc


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/1e63316f
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/1e63316f
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/1e63316f

Branch: refs/heads/MARMOTTA-588
Commit: 1e63316f63484e1af6737d3b8e0a73ebe1dddf14
Parents: b605948
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 14:53:27 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 14:53:27 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-webapp/README.md | 35 +++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/1e63316f/launchers/marmotta-webapp/README.md
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/README.md b/launchers/marmotta-webapp/README.md
index 9e45c2a..d1ace68 100644
--- a/launchers/marmotta-webapp/README.md
+++ b/launchers/marmotta-webapp/README.md
@@ -1,21 +1,32 @@
-# Apache Marmotta Docker launcher
+# Apache Marmotta Webapp Launcher
 
-This launcher creates a Docker images that you can user for developing or testing
-Apache Marmotta.
+This folder contains a JavaEE Web Application for launching Marmotta in any Servlet (>=3.0) container.
 
-## Build image
+## WAR
 
-    sudo docker build -t marmotta .
+For building the WAR just execute:
 
-## Get image
+    mvn package
 
-@@TODO@@: push it to asf or docker hub
+and you'll find the WAR file at `target/marmotta.war`.
+
+## Debian
+
+The build also provides supprt for Debian packages, just append the profile to the regular build command:
+
+    mvn package -Pdebian
 
-## Run
+and you'll find the `.deb` file `target/`.
 
-    docker run -p 8080:8080
+## Docker
 
-## Accesss
+It also comes witth support for creating a Docker images that you can user for developing or testing
+Apache Marmotta.
+
+* Build image: `docker build -t marmotta .`
+* Run the image: `docker run -p 8080:8080 marmotta`
+* Access Marmotta at [localhost:8080/marmotta](http://localhost:8080/marmotta) (IP address may be different, 
+  use `docker inspect CONTAINER_ID` for details).
+
+@@TODO@@: push it to asf or docker hub
 
-Access Marmotta runing inside the container, at [172.17.42.1:8080/marmotta](http://172.17.42.1:8080/marmotta) 
-(IP address may be different, use `docker inspect CONTAINER_ID` for details).


[5/6] marmotta git commit: MARMOTTA-588: fixed psql setup

Posted by wi...@apache.org.
MARMOTTA-588: fixed psql setup


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/92fadba3
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/92fadba3
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/92fadba3

Branch: refs/heads/MARMOTTA-588
Commit: 92fadba3de462285b657ef2d83446273aa6dd0ad
Parents: 1e63316
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 15:55:04 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 15:55:04 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-webapp/Dockerfile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/92fadba3/launchers/marmotta-webapp/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/Dockerfile b/launchers/marmotta-webapp/Dockerfile
index f7db670..26713a8 100644
--- a/launchers/marmotta-webapp/Dockerfile
+++ b/launchers/marmotta-webapp/Dockerfile
@@ -38,6 +38,7 @@ RUN service postgresql start \
     && psql --command "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';" \
     && psql --command "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER;"
 USER root
+RUN service postgresql stop
 RUN echo "host all  all    127.0.0.1/32  md5" >> /etc/postgresql/$PG_VERSION/main/pg_hba.conf
 RUN echo "listen_addresses='*'" >> /etc/postgresql/$PG_VERSION/main/postgresql.conf
 
@@ -60,13 +61,14 @@ RUN echo "security.enabled = false" > $CONF_PATH
 RUN echo "database.type = postgres" >> $CONF_PATH
 RUN echo "database.url = jdbc:postgresql://localhost:5432/$DB_NAME?prepareThreshold=3" >> $CONF_PATH
 RUN echo "database.user = $DB_USER" >> $CONF_PATH
-RUN echo "database.password = $dbpas" >> $CONF_PATH
+RUN echo "database.password = $DB_PASS" >> $CONF_PATH
 RUN chown -R tomcat7:tomcat7 "$(dirname $CONF_PATH)"
 
 # cleanup
 #RUN mvn clean
 RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
 
-CMD service tomcat7 start; \
+CMD service postgresql start; \
+    service tomcat7 start; \
 	tail -f /var/log/tomcat7/catalina.out
 


[3/6] marmotta git commit: MARMOTTA-588: completelly new Dockerfile using PostgreSQL

Posted by wi...@apache.org.
MARMOTTA-588: completelly new Dockerfile using PostgreSQL


Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/b6059481
Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/b6059481
Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/b6059481

Branch: refs/heads/MARMOTTA-588
Commit: b6059481b87242dcc73e99db3300b0a031691753
Parents: f825e57
Author: Sergio Fernández <wi...@apache.org>
Authored: Thu Nov 12 14:44:16 2015 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Thu Nov 12 14:52:57 2015 +0100

----------------------------------------------------------------------
 launchers/marmotta-webapp/Dockerfile | 99 ++++++++++++++++++-------------
 1 file changed, 59 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/b6059481/launchers/marmotta-webapp/Dockerfile
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/Dockerfile b/launchers/marmotta-webapp/Dockerfile
index 2eb235c..f7db670 100644
--- a/launchers/marmotta-webapp/Dockerfile
+++ b/launchers/marmotta-webapp/Dockerfile
@@ -1,53 +1,72 @@
 # Dockerfile for Apache Marmotta
 
-FROM debian:sid
+FROM debian:jessie
 MAINTAINER Sergio Fernández <wi...@apache.org>
-WORKDIR /src
+
 EXPOSE 8080
-EXPOSE 5432
 
-# general configuration
+WORKDIR /marmotta-webapp
+ADD . /marmotta-webapp
+
+# configuration
 ENV DEBIAN_FRONTEND noninteractive
-ENV baseurl http://localhost:8080/marmotta
-ENV dbname marmotta
-ENV dbuser marmotta
-ENV dbpass s3cr3t
-ENV conf /var/lib/marmotta/system-config.properties
-
-# install base system
-RUN sed -i.bak s/"exit 101"/"exit 0"/g /usr/sbin/policy-rc.d
-RUN apt-get update
-RUN apt-get install -y apt-utils
-RUN apt-get upgrade -y
-RUN apt-get install -y sudo
-RUN apt-get install -y locales
-RUN locale-gen en_US.UTF-8 en_us && dpkg-reconfigure locales && dpkg-reconfigure locales && locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
-RUN apt-get install -y git ssmtp
-RUN apt-get install -y openjdk-7-jre-headless openjdk-7-jdk maven
-RUN apt-get install -y tomcat7
-RUN apt-get install -y postgresql postgresql-common postgresql-contrib
-
-# pre-setup
+ENV DB_NAME marmotta
+ENV DB_USER marmotta
+ENV DB_PASS s3cr3t
+ENV PG_VERSION 9.4
+ENV WAR_PATH target/marmotta.war
+ENV CONF_PATH /var/lib/marmotta/system-config.properties
+
+# test build
+RUN test -e $WAR_PATH || exit
+
+# install and configure postgres from the PGDG repo
+RUN apt-get update && apt-get install -y locales apt-utils \
+	&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
+ENV LANG en_US.utf8
+RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
+RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' > /etc/apt/sources.list.d/pgdg.list
+RUN apt-get update \
+	&& apt-get install -y postgresql-common \
+	&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
+	&& apt-get install -y \
+		postgresql-$PG_VERSION \
+		postgresql-contrib-$PG_VERSION
+RUN pg_createcluster $PG_VERSION main --start
 USER postgres
-RUN psql -c "CREATE USER $dbuser WITH PASSWORD '$dbpass'"
-RUN psql -c "CREATE DATABASE $dbname WITH OWNER $dbuser"
+RUN service postgresql start \
+    && psql --command "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';" \
+    && psql --command "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER;"
 USER root
-RUN mkdir -p "$(dirname $conf)"
-RUN echo "" > $conf
-RUN echo "security.enabled = false" >> $conf
-RUN echo "database.type = postgres" >> $conf
-RUN echo "database.url = jdbc:postgresql://localhost:5432/$dbname?prepareThreshold=3" >> $conf
-RUN echo "database.user = $dbuser" >> $conf
-RUN echo "database.password = $dbpas" >> $conf
-RUN chmod -R tomcat7:tomcat7 "$(dirname $conf)"
+RUN echo "host all  all    127.0.0.1/32  md5" >> /etc/postgresql/$PG_VERSION/main/pg_hba.conf
+RUN echo "listen_addresses='*'" >> /etc/postgresql/$PG_VERSION/main/postgresql.conf
+
+# base requirements
+RUN apt-get update \
+	&& apt-get install -y \
+		openjdk-7-jre-headless \
+		tomcat7
+RUN service tomcat7 stop
 
 # package from source code and install the webapp
-RUN git clone -b develop https://git-wip-us.apache.org/repos/asf/marmotta.git
-RUN cd marmotta/launchers/marmotta-webapp/ && mvn clean package -Djdeb.signing=false
-RUN dpkg -i marmotta/launchers/marmotta-webapp/target/marmotta*.deb
+#RUN dpkg --debug=2000 --install target/marmotta_*_all.deb <-- we'd need to fix the postinst
+RUN mkdir -p /usr/share/marmotta
+RUN cp $WAR_PATH /usr/share/marmotta/
+RUN chown tomcat7:tomcat7 /usr/share/marmotta/marmotta.war
+RUN cp src/deb/tomcat/marmotta.xml /var/lib/tomcat7/conf/Catalina/localhost/
+RUN chown tomcat7:tomcat7 /var/lib/tomcat7/conf/Catalina/localhost/marmotta.xml
+RUN mkdir -p "$(dirname $CONF_PATH)"
+RUN echo "security.enabled = false" > $CONF_PATH
+RUN echo "database.type = postgres" >> $CONF_PATH
+RUN echo "database.url = jdbc:postgresql://localhost:5432/$DB_NAME?prepareThreshold=3" >> $CONF_PATH
+RUN echo "database.user = $DB_USER" >> $CONF_PATH
+RUN echo "database.password = $dbpas" >> $CONF_PATH
+RUN chown -R tomcat7:tomcat7 "$(dirname $CONF_PATH)"
 
 # cleanup
-#RUN cd marmotta/ && mvn clean
-RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y
-RUN mv /usr/sbin/policy-rc.d.bak /usr/sbin/policy-rc.d
+#RUN mvn clean
+RUN apt-get clean -y && apt-get autoclean -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
+
+CMD service tomcat7 start; \
+	tail -f /var/log/tomcat7/catalina.out