diff --git a/4.docker/createApplicationUser.sh b/4.config/createApplicationUser.sh similarity index 100% rename from 4.docker/createApplicationUser.sh rename to 4.config/createApplicationUser.sh diff --git a/4.docker/createManagementUser.sh b/4.config/createManagementUser.sh similarity index 100% rename from 4.docker/createManagementUser.sh rename to 4.config/createManagementUser.sh diff --git a/4.docker/module.xml b/4.config/module.xml similarity index 100% rename from 4.docker/module.xml rename to 4.config/module.xml diff --git a/4.docker/postgresql-9.4.1209.jar b/4.config/postgresql-9.4.1209.jar similarity index 100% rename from 4.docker/postgresql-9.4.1209.jar rename to 4.config/postgresql-9.4.1209.jar diff --git a/4.docker/standalone.xml b/4.config/standalone.xml similarity index 100% rename from 4.docker/standalone.xml rename to 4.config/standalone.xml diff --git a/4.docker/Dockerfile b/4.docker/Dockerfile deleted file mode 100644 index 53df906..0000000 --- a/4.docker/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM jboss/wildfly:14.0.1.Final - -# User root user to install software -USER root -RUN yum -y install expect -RUN yum -y install postgresql - -# Switch back to jboss user -USER jboss - -ADD createApplicationUser.sh /opt/jboss/wildfly/bin/ -ADD createManagementUser.sh /opt/jboss/wildfly/bin/ - -RUN cd /opt/jboss/wildfly/bin && ./createApplicationUser.sh -RUN cd /opt/jboss/wildfly/bin && ./createManagementUser.sh - -ADD MyHealth.ear /opt/jboss/wildfly/standalone/deployments/ -RUN mkdir /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/ -RUN mkdir /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main -ADD postgresql-9.4.1209.jar /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main -ADD module.xml /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main -ADD standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml - -CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"] \ No newline at end of file diff --git a/4.docker/MyHealth.ear b/4.docker/MyHealth.ear deleted file mode 100644 index aa3b459..0000000 Binary files a/4.docker/MyHealth.ear and /dev/null differ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75e1b4e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM jboss/wildfly:14.0.1.Final + +# User root user to install software +USER root +RUN yum -y install expect +RUN yum -y install postgresql +RUN yum -y install ant + +# Compile and copy .ear to deployments +ADD ./1.sources/ /opt/jboss/ +RUN cd /opt/jboss/MyHealth && ant +RUN mv /opt/jboss/MyHealth/dist/MyHealth.ear /opt/jboss/wildfly/standalone/deployments + +# Switch back to jboss user +USER jboss + +ADD ./4.config/createApplicationUser.sh /opt/jboss/wildfly/bin/ +ADD ./4.config/createManagementUser.sh /opt/jboss/wildfly/bin/ + +RUN cd /opt/jboss/wildfly/bin && ./createApplicationUser.sh +RUN cd /opt/jboss/wildfly/bin && ./createManagementUser.sh + +RUN mkdir /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/ +RUN mkdir /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main +ADD ./4.config/postgresql-9.4.1209.jar /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main +ADD ./4.config/module.xml /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main +ADD ./4.config/standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml + +CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"] \ No newline at end of file diff --git a/4.docker/docker-compose.yml b/docker-compose.yml similarity index 85% rename from 4.docker/docker-compose.yml rename to docker-compose.yml index 4ed21ba..6606486 100644 --- a/4.docker/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: - POSTGRES_PASSWORD=PASSWORD - POSTGRES_DB=myhealth volumes: - - ../2.database/01.CreateTables.sql:/docker-entrypoint-initdb.d/init.sql + - ./2.database/01.CreateTables.sql:/docker-entrypoint-initdb.d/init.sql wildfly: build: . ports: