Sure, it is. I don't want to complicate my original blog post and I think introducing a multistage concept right now is not that good (I'll do it in upcoming article) but here is an example of such Dockerfile.
FROM gradle:6.7-jdk8 AS buildRUN mkdir-p /workspace
WORKDIR /workspaceCOPY . /workspaceRUN gradle build
FROM java:8-jdk-alpineCOPY --from=build /workspace/build/libs/nasapicture-0.0.1-SNAPSHOT.war /usr/app/WORKDIR /usr/appEXPOSE 8080ENTRYPOINT ["java", "-jar", "nasapicture-0.0.1-SNAPSHOT.war"]
Single-page application which display NASA's Astronomy Picture of the Day
This sample demonstrates how to run a Dockerized Java application on DigitalOcean App Platform. Since App Platform doesn't yet support Java, this sample shows how to accomplish this using Dockerfile.
To use all the features of App Platform, you need to be running against your own copy of this application. To make a copy, click the Fork button above and follow the on-screen instructions. In this case, you'll be forking this repo as a starting point for your own app (see Github documentation to learn more about forking repos.
Is it possible to include this step in the Dockerfile?
Sure, it is. I don't want to complicate my original blog post and I think introducing a multistage concept right now is not that good (I'll do it in upcoming article) but here is an example of such Dockerfile.
Please let me know if you have any questions
Awesome. Thanks a lot.
I was just trying to get a containerized Java app running on DigitalOcean App Platform. Here it is:
creativefisher / Nasa-Picture
Single-page application which display NASA's Astronomy Picture of the Day
This sample demonstrates how to run a Dockerized Java application on DigitalOcean App Platform. Since App Platform doesn't yet support Java, this sample shows how to accomplish this using Dockerfile.
This sample has been adapted from github.com/wkrzywiec/Nasa-Picture
Getting Started
These steps will get this sample application running for you using DigitalOcean.
Note: Following these steps will result in charges for the use of DigitalOcean services
Requirements
Forking the Sample App Source Code
To use all the features of App Platform, you need to be running against your own copy of this application. To make a copy, click the Fork button above and follow the on-screen instructions. In this case, you'll be forking this repo as a starting point for your own app (see Github documentation to learn more about forking repos.
After forking…
And here is the deployed app: nasa-picture-2-bdhmn.ondigitalocea...
Great! 🙂 Again thanks for pointing this out in the post.
And also I'm really impressed that you have adapted this project to deploy it on Digital Ocean