Mercurial > lada > lada-server
annotate Dockerfile @ 750:6a24f01bdaac
Improve install doc.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 28 Oct 2015 12:14:22 +0100 |
parents | cb841ed21405 |
children | 4f9b5500541c |
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 |
cb841ed21405
Dockerfile: add comment where server is reachable.
Tom Gottfried <tom@intevation.de>
parents:
748
diff
changeset
|
12 # http://yourdockerhost:8181/lada-server-2.2.0 |
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 && \ |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 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
|
23 maven |
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 |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
38 EXPOSE 8080 9990 |
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 |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
50 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
|
51 $JBOSS_HOME/modules/org/postgres/main/ |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
52 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
|
53 $JBOSS_HOME/modules/org/postgres/main/ |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
54 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
|
55 $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
|
56 RUN curl \ |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
57 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
|
58 $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
|
59 |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
60 RUN cp wildfly/postgres-module.xml \ |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
61 $JBOSS_HOME/modules/org/postgres/main/module.xml |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
62 RUN cp wildfly/hibernate-module.xml \ |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
63 $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
|
64 |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
65 RUN wildfly/execute.sh |
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 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
|
68 |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
69 # |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
70 # Build and deploy LADA-server |
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 mvn clean compile package |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
73 RUN mv target/lada-server-2.2.0.war $JBOSS_HOME/standalone/deployments |
750 | 74 RUN touch $JBOSS_HOME/standalone/deployments/lada-server-2.2.0.war.dodeploy |
748
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 # 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
|
78 # |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
79 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
|
80 "-bmanagement=0.0.0.0"] |