annotate Dockerfile @ 748:75e87b7d37c0

Add dockerised setup for running the server.
author Tom Gottfried <tom@intevation.de>
date Tue, 27 Oct 2015 18:38:54 +0100
parents
children cb841ed21405
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'
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
9 # The linked container may be created from db_schema/Dockerfile
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
10 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
11
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
12 FROM java:7-jdk
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
13 MAINTAINER raimund.renkert@intevation.de
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 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
16 # install packages
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 RUN apt-get update -y && \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
19 apt-get install -y libpostgresql-jdbc-java libpostgis-java libjts-java \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
20 maven
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
21
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
22 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
23 # Set up Wildfly
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 RUN mkdir /opt/jboss
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
26
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
27 RUN curl \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
28 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
29 | 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
30
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
31 ENV JBOSS_HOME /opt/jboss/wildfly
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
32
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
33 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
34
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
35 EXPOSE 8080 9990
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
36
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
37 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
38 # Add LADA-server repo
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 ADD . /usr/src/lada-server
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
41 WORKDIR /usr/src/lada-server
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 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
44 # Wildfly setup specific for LADA
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 RUN mkdir -p $JBOSS_HOME/modules/org/postgres/main
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
47 RUN ln -s /usr/share/java/postgresql-jdbc4-9.2.jar \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
48 $JBOSS_HOME/modules/org/postgres/main/
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
49 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
50 $JBOSS_HOME/modules/org/postgres/main/
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
51 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
52 $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
53 RUN curl \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
54 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
55 $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
56
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
57 RUN cp wildfly/postgres-module.xml \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
58 $JBOSS_HOME/modules/org/postgres/main/module.xml
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
59 RUN cp wildfly/hibernate-module.xml \
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
60 $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/module.xml
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
61
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
62 RUN wildfly/execute.sh
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
63
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
64 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
65
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
66 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
67 # Build and deploy LADA-server
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 mvn clean compile package
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
70 RUN mv target/lada-server-2.2.0.war $JBOSS_HOME/standalone/deployments
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
71 RUN touch $JBOSS_HOME/standalone/deployments/lada-server.war.dodeploy
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 # 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
75 #
75e87b7d37c0 Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
76 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
77 "-bmanagement=0.0.0.0"]
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)