Skip to content

Commit a3cb2d2

Browse files
committed
added docker file for jaxrs resteasy
1 parent 265e269 commit a3cb2d2

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public void processOpts() {
9999
supportingFiles.add(new SupportingFile("LocalDateProvider.mustache",
100100
(sourceFolder + '/' + apiPackage).replace(".", "/"), "LocalDateProvider.java"));
101101
}
102+
writeOptional(outputFolder, new SupportingFile("Dockerfile.mustache", "", "Dockerfile"));
102103
}
103104

104105
@Override
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM jboss/wildfly:21.0.2.Final
2+
3+
ADD target/{{artifactId}}-{{artifactVersion}}.war /opt/jboss/wildfly/standalone/deployments/
4+
5+
EXPOSE 8080 9990 8009
6+
7+
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"]

modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/README.mustache

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ is an example of building a swagger-enabled JAX-RS server.
77

88
This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework.
99

10-
To run the server, please execute the following:
10+
To run with docker, please execute the following:
1111

1212
```
13-
mvn clean package jetty:run
13+
mvn package
14+
15+
docker build -q --rm --tag=swagger-codegen-resteasy .
16+
17+
docker run -d -p 8080:8080 -p 9990:9990 -p 8009:8009 --name swagger-resteasy -it swagger-codegen-resteasy
1418
```
1519

1620
You can then view the swagger listing here:
1721

1822
```
1923
http://localhost:{{serverPort}}{{contextPath}}/swagger.json
2024
```
21-
22-
Note that if you have configured the `host` to be something other than localhost, the calls through
23-
swagger-ui will be directed to that host and not localhost!
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM jboss/wildfly:21.0.2.Final
2+
3+
ADD target/swagger-jaxrs-resteasy-server-1.0.0.war /opt/jboss/wildfly/standalone/deployments/
4+
5+
EXPOSE 8080 9990 8009
6+
7+
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM jboss/wildfly:21.0.2.Final
2+
3+
ADD target/swagger-jaxrs-resteasy-java8-server-1.0.0.war /opt/jboss/wildfly/standalone/deployments/
4+
5+
EXPOSE 8080 9990 8009
6+
7+
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM jboss/wildfly:21.0.2.Final
2+
3+
ADD target/swagger-jaxrs-resteasy-joda-server-1.0.0.war /opt/jboss/wildfly/standalone/deployments/
4+
5+
EXPOSE 8080 9990 8009
6+
7+
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"]

0 commit comments

Comments
 (0)