-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change dockerfile to multistep build
- Loading branch information
1 parent
0d52968
commit ef9037c
Showing
1 changed file
with
6 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
FROM quay.io/wildfly/wildfly:latest-jdk21 | ||
|
||
ADD gamertrack-war/target/gepardec-gamertrack.war /opt/jboss/wildfly/standalone/deployments/ | ||
|
||
COPY ChangeDataSource.sh /opt/jboss/wildfly/ChangeDataSource.sh | ||
FROM quay.io/wildfly/wildfly:latest-jdk21 AS build | ||
|
||
USER root | ||
WORKDIR /opt/jboss/wildfly/bin | ||
|
||
RUN chmod +x /opt/jboss/wildfly/ChangeDataSource.sh | ||
RUN chmod -R 777 /opt/jboss/ | ||
RUN ./jboss-cli.sh --commands="embed-server --std-out=echo --server-config=standalone.xml, /subsystem=datasources/data-source=ExampleDS:write-attribute(name=connection-url, value=\"jdbc:h2:file:/opt/jboss/wildfly/gamertrackDB;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=\${wildfly.h2.compatibility.mode:REGULAR}\")" | ||
|
||
USER jboss | ||
|
||
RUN /opt/jboss/wildfly/ChangeDataSource.sh | ||
|
||
USER root | ||
RUN chmod -R 777 /opt/jboss/wildfly | ||
USER jboss | ||
FROM quay.io/wildfly/wildfly:latest-jdk21 | ||
COPY --from=build /opt/jboss/wildfly/standalone/configuration/standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml | ||
ADD gamertrack-war/target/gepardec-gamertrack.war /opt/jboss/wildfly/standalone/deployments/ | ||
|
||
|
||
ENTRYPOINT ["/bin/bash", "-c", "/opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0"] |