我了解JHipster使用基于Spring Boot的REST服务构建Web应用程序。我想在不同的docker容器上部署各种springboot服务,任何想法如何实现这种配置?
最佳答案
您可以按照“Spring Boot with Docker”进行操作:事实证明所需的Dockerfile非常简单
let’s go ahead and create a Dockerfile in our Spring Boot project:
FROM java:8
VOLUME /tmp
ADD gs-spring-boot-docker-0.1.0.jar app.jar
RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
This Dockerfile is very simple, but that’s all you need to run a Spring Boot app with no frills: just Java and a JAR file.
The project JAR file isADD
ed to the container as "app.jar
" and then executed in theENTRYPOINT
.
关于docker - 如何使JHipster应用程序REST服务在不同的Docker容器上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34378614/