annotate Dockerfile @ 1045:61b94641cf99

A period with end before start is not meaningful. This is true for the subintervall, too.
author Tom Gottfried <tom@intevation.de>
date Thu, 08 Sep 2016 12:03:43 +0200
parents 01ce190079e5
children 163d1abaece7
rev   line source
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
1 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
2 # Dockerfile for jboss wildfly application server cutomized for usage in the
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
3 # BfS-Lada project
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
4 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
5 # Build with e.g. `docker build --force-rm=true -t koala/lada_wildfly .'
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
6 # Run with e.g.
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
7 # `docker run --name lada_wildfly --link lada_db:lada_db
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
8 # -dp 8181:8080 -p 1818:9990 koala/lada_wildfly'
749
cb841ed21405 Dockerfile: add comment where server is reachable.
Tom Gottfried <tom@intevation.de>
parents: 748
diff changeset
9 # The linked container may be created from db_schema/Dockerfile.
cb841ed21405 Dockerfile: add comment where server is reachable.
Tom Gottfried <tom@intevation.de>
parents: 748
diff changeset
10 #
cb841ed21405 Dockerfile: add comment where server is reachable.
Tom Gottfried <tom@intevation.de>
parents: 748
diff changeset
11 # The LADA-server will be available under
976
01ce190079e5 Adapt LADA version in Dockerfile.
Tom Gottfried <tom@intevation.de>
parents: 888
diff changeset
12 # http://yourdockerhost:8181/lada-server-$LADA_VERSION
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
13 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
14
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
15 FROM java:7-jdk
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
16 MAINTAINER raimund.renkert@intevation.de
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
17
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
18 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
19 # install packages
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
20 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
21 RUN apt-get update -y && \
761
4f9b5500541c Package versions of Postgres and Postgres-JDBC do not match in jessie.
Tom Gottfried <tom@intevation.de>
parents: 750
diff changeset
22 apt-get install -y libpostgis-java libjts-java \
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
23 maven lighttpd
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
24
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
25 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
26 # Set up Wildfly
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
27 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
28 RUN mkdir /opt/jboss
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
29
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
30 RUN curl \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
31 https://download.jboss.org/wildfly/8.2.1.Final/wildfly-8.2.1.Final.tar.gz \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
32 | tar zx && mv wildfly-8.2.1.Final /opt/jboss/wildfly
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
33
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
34 ENV JBOSS_HOME /opt/jboss/wildfly
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
35
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
36 RUN $JBOSS_HOME/bin/add-user.sh admin secret --silent
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
37
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
38 EXPOSE 8080 9990 80
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
39
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
40 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
41 # Add LADA-server repo
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
42 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
43 ADD . /usr/src/lada-server
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
44 WORKDIR /usr/src/lada-server
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
45
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
46 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
47 # Wildfly setup specific for LADA
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
48 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
49 RUN mkdir -p $JBOSS_HOME/modules/org/postgres/main
761
4f9b5500541c Package versions of Postgres and Postgres-JDBC do not match in jessie.
Tom Gottfried <tom@intevation.de>
parents: 750
diff changeset
50
888
27febad6fb84 Use correctly working Postgres-JDBC-driver.
Tom Gottfried <tom@intevation.de>
parents: 852
diff changeset
51 RUN curl https://jdbc.postgresql.org/download/postgresql-9.4-1200.jdbc4.jar >\
27febad6fb84 Use correctly working Postgres-JDBC-driver.
Tom Gottfried <tom@intevation.de>
parents: 852
diff changeset
52 $JBOSS_HOME/modules/org/postgres/main/postgresql.jar
761
4f9b5500541c Package versions of Postgres and Postgres-JDBC do not match in jessie.
Tom Gottfried <tom@intevation.de>
parents: 750
diff changeset
53
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
54 RUN ln -s /usr/share/java/postgis-jdbc-2.1.4.jar \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
55 $JBOSS_HOME/modules/org/postgres/main/
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
56 RUN ln -s /usr/share/java/jts-1.11.jar \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
57 $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/
763
8cf21cd01287 Symlinks allow editing module config in place.
Tom Gottfried <tom@intevation.de>
parents: 761
diff changeset
58
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
59 RUN curl \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
60 http://www.hibernatespatial.org/repository/org/hibernate/hibernate-spatial/4.3/hibernate-spatial-4.3.jar > \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
61 $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/hibernate-spatial-4.3.jar
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
62
763
8cf21cd01287 Symlinks allow editing module config in place.
Tom Gottfried <tom@intevation.de>
parents: 761
diff changeset
63 RUN ln -s $PWD/wildfly/postgres-module.xml \
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
64 $JBOSS_HOME/modules/org/postgres/main/module.xml
763
8cf21cd01287 Symlinks allow editing module config in place.
Tom Gottfried <tom@intevation.de>
parents: 761
diff changeset
65 RUN ln -fs $PWD/wildfly/hibernate-module.xml \
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
66 $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/module.xml
783
c19bd80d1f62 Fix setting symlink (file exists).
Tom Gottfried <tom@intevation.de>
parents: 781
diff changeset
67 RUN ln -fs $PWD/wildfly/standalone.conf $JBOSS_HOME/bin/
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
68
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
69 RUN wildfly/execute.sh
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
70
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
71 RUN rm $JBOSS_HOME/standalone/configuration/standalone_xml_history/current/*
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
72
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
73 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
74 # Build and deploy LADA-server
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
75 #
976
01ce190079e5 Adapt LADA version in Dockerfile.
Tom Gottfried <tom@intevation.de>
parents: 888
diff changeset
76 ENV LADA_VERSION 2.3.0
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
77 RUN mvn clean compile package javadoc:javadoc
976
01ce190079e5 Adapt LADA version in Dockerfile.
Tom Gottfried <tom@intevation.de>
parents: 888
diff changeset
78 RUN mv target/lada-server-$LADA_VERSION.war $JBOSS_HOME/standalone/deployments
01ce190079e5 Adapt LADA version in Dockerfile.
Tom Gottfried <tom@intevation.de>
parents: 888
diff changeset
79 RUN touch $JBOSS_HOME/standalone/deployments/lada-server-$LADA_VERSION.war.dodeploy
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
80
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
81 ##configure lighttpd for apidoc
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
82 RUN sed -i 's|server.document-root = "/var/www/html"|server.document-root = "/usr/src/lada-server/target/site/apidocs"|' /etc/lighttpd/lighttpd.conf
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
83
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
84 ## Start the webserver manually, when the container is started
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
85 # service lighttpd start
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
86
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
87 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
88 # This will boot WildFly in the standalone mode and bind to all interface
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
89 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
90 CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
91 "-bmanagement=0.0.0.0"]
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
92
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)