diff --git a/docs/serving/samples/hello-world/helloworld-java-spark/Dockerfile b/docs/serving/samples/hello-world/helloworld-java-spark/Dockerfile index c0a304795..0eaae5b52 100644 --- a/docs/serving/samples/hello-world/helloworld-java-spark/Dockerfile +++ b/docs/serving/samples/hello-world/helloworld-java-spark/Dockerfile @@ -18,9 +18,6 @@ FROM openjdk:8-jre-alpine # Copy the jar to the production image from the builder stage. COPY --from=builder /app/target/helloworld-0.0.1-SNAPSHOT-jar-with-dependencies.jar /helloworld.jar -# Service must listen to $PORT environment variable. -# This default value facilitates local development. -ENV PORT 8080 # Run the web service on container startup. CMD ["java","-Dserver.port=${PORT}","-jar","/helloworld.jar"] diff --git a/docs/serving/samples/hello-world/helloworld-java-spark/src/main/java/com/example/helloworld/HelloWorldApplication.java b/docs/serving/samples/hello-world/helloworld-java-spark/src/main/java/com/example/helloworld/HelloWorldApplication.java index 30c0c764b..c1a36a198 100644 --- a/docs/serving/samples/hello-world/helloworld-java-spark/src/main/java/com/example/helloworld/HelloWorldApplication.java +++ b/docs/serving/samples/hello-world/helloworld-java-spark/src/main/java/com/example/helloworld/HelloWorldApplication.java @@ -8,10 +8,17 @@ public class HelloWorldApplication { public static void main(String args[]) { - //Default port in SparkJava is 4567 - // Setting the PORT to 8080 here - if(System.getenv("PORT") != null) - port(Integer.valueOf(System.getenv("PORT"))); + + /* + * Please Note: + * Default port in SparkJava is 4567 + * If you wish to use port of your choice, + * uncomment the following code and set the + * required port + */ + + //private static final String PORT = "8080"; + //port(Integer.valueOf(System.getenv("PORT"))); if( System.getenv("TARGET") == null) message = "World";