Mercurial > lada > lada-server
annotate Dockerfile @ 802:b04e55896104
Authorize messwert, kommentar and status.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 19 Nov 2015 16:54:09 +0100 |
parents | c19bd80d1f62 |
children | 2f467a014619 |
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 && \ |
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 \ |
748
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 |
761
4f9b5500541c
Package versions of Postgres and Postgres-JDBC do not match in jessie.
Tom Gottfried <tom@intevation.de>
parents:
750
diff
changeset
|
50 |
4f9b5500541c
Package versions of Postgres and Postgres-JDBC do not match in jessie.
Tom Gottfried <tom@intevation.de>
parents:
750
diff
changeset
|
51 RUN curl https://jdbc.postgresql.org/download/postgresql-9.4-1204.jdbc41.jar >\ |
4f9b5500541c
Package versions of Postgres and Postgres-JDBC do not match in jessie.
Tom Gottfried <tom@intevation.de>
parents:
750
diff
changeset
|
52 $JBOSS_HOME/modules/org/postgres/main/postgresql-9.4-1204.jdbc41.jar |
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 # |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
76 RUN mvn clean compile package |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
77 RUN mv target/lada-server-2.2.0.war $JBOSS_HOME/standalone/deployments |
750 | 78 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
|
79 |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
80 # |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
81 # 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
|
82 # |
75e87b7d37c0
Add dockerised setup for running the server.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
83 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
|
84 "-bmanagement=0.0.0.0"] |