annotate Dockerfile @ 1341:5f7f2157a7b8

backout tag 2.6.1 commit
author Marco Lechner, Bundesamt fuer Strahlenschutz, SW 2.1 <mlechner@bfs.de>
date Fri, 07 Apr 2017 10:59:49 +0200
parents 739ad8e78fca
children 523c4a436896
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
1234
28a39466e4eb Enable deserialization of geometries with DBUnit.
Tom Gottfried <tom@intevation.de>
parents: 1202
diff changeset
67 # The jdbcadapters need to know the postgres module to cope with PGeometry
28a39466e4eb Enable deserialization of geometries with DBUnit.
Tom Gottfried <tom@intevation.de>
parents: 1202
diff changeset
68 RUN sed -i '/<\/dependencies>/i <module name="org.postgres"/>' \
28a39466e4eb Enable deserialization of geometries with DBUnit.
Tom Gottfried <tom@intevation.de>
parents: 1202
diff changeset
69 $JBOSS_HOME/modules/system/layers/base/org/jboss/ironjacamar/jdbcadapters/main/module.xml
783
c19bd80d1f62 Fix setting symlink (file exists).
Tom Gottfried <tom@intevation.de>
parents: 781
diff changeset
70 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
71
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
72 RUN wildfly/execute.sh
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 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
75
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
76 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
77 # Build and deploy LADA-server
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
78 #
1334
739ad8e78fca tag 2.6.1
Michael Stanko <mstanko@bfs.de>
parents: 1330
diff changeset
79 ENV LADA_VERSION 2.6.1
1202
61106ead36fc Separate build/deploy and javadoc.
Tom Gottfried <tom@intevation.de>
parents: 1141
diff changeset
80 RUN mvn clean compile package && \
61106ead36fc Separate build/deploy and javadoc.
Tom Gottfried <tom@intevation.de>
parents: 1141
diff changeset
81 mv target/lada-server-$LADA_VERSION.war \
61106ead36fc Separate build/deploy and javadoc.
Tom Gottfried <tom@intevation.de>
parents: 1141
diff changeset
82 $JBOSS_HOME/standalone/deployments && \
61106ead36fc Separate build/deploy and javadoc.
Tom Gottfried <tom@intevation.de>
parents: 1141
diff changeset
83 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
84
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
85 ##configure lighttpd for apidoc
1202
61106ead36fc Separate build/deploy and javadoc.
Tom Gottfried <tom@intevation.de>
parents: 1141
diff changeset
86 RUN mvn javadoc:javadoc
852
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
87 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
88
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
89 ## 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
90 # service lighttpd start
2f467a014619 Added lighttpd to Dockerfile in order to serve apidoc is necessary
Dustin Demuth <dustin@intevation.de>
parents: 783
diff changeset
91
748
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
92 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
93 # 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
94 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
95 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
96 "-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
97
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)